Skip to content

Commit 688c68e

Browse files
committed
pin jason
1 parent 21a2db9 commit 688c68e

File tree

22 files changed

+38
-36
lines changed

22 files changed

+38
-36
lines changed

apps/elixir_ls_debugger/mix.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ defmodule ElixirLS.Debugger.Mixfile do
3535
{:elixir_sense,
3636
github: "elixir-lsp/elixir_sense", ref: "71efd1e2efbac43e6c98c525cc879ddd747ac62e"},
3737
{:elixir_ls_utils, in_umbrella: true},
38+
{:jason_v, github: "elixir-lsp/jason", ref: "c81537e2a5e1acacb915cf339fe400357e3c2aaa"},
3839
{:dialyxir_vendored, github: "elixir-lsp/dialyxir", branch: "vendored", runtime: false}
3940
]
4041
end

apps/elixir_ls_utils/lib/packet_stream.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ defmodule ElixirLS.Utils.PacketStream do
9090
^content_length ->
9191
# though jason docs suggest using `strings: :copy` when parts of binary may be stored
9292
# processes/ets in our case it does not help (as of OTP 23)
93-
JasonVendored.decode(body)
93+
JasonV.decode(body)
9494

9595
_other ->
9696
{:error, :truncated}

apps/elixir_ls_utils/lib/wire_protocol.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defmodule ElixirLS.Utils.WireProtocol do
88

99
def send(packet) do
1010
pid = io_dest()
11-
body = JasonVendored.encode_to_iodata!(packet)
11+
body = JasonV.encode_to_iodata!(packet)
1212

1313
IO.binwrite(pid, [
1414
"Content-Length: ",

apps/elixir_ls_utils/mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ defmodule ElixirLS.Utils.Mixfile do
2121
build_per_environment: false,
2222
consolidate_protocols: false,
2323
deps: deps(),
24-
xref: [exclude: [JasonVendored, Logger, Hex]]
24+
xref: [exclude: [JasonV, Logger, Hex]]
2525
]
2626
end
2727

@@ -32,7 +32,7 @@ defmodule ElixirLS.Utils.Mixfile do
3232

3333
defp deps do
3434
[
35-
{:jason_vendored, github: "elixir-lsp/jason", branch: "vendored"},
35+
{:jason_v, github: "elixir-lsp/jason", ref: "c81537e2a5e1acacb915cf339fe400357e3c2aaa"},
3636
{:mix_task_archive_deps, github: "elixir-lsp/mix_task_archive_deps"},
3737
{:dialyxir_vendored, github: "elixir-lsp/dialyxir", branch: "vendored", runtime: false}
3838
]

apps/elixir_ls_utils/test/packet_stream_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ defmodule ElixirLS.Utils.PacketStreamTest do
177177
|> Enum.to_list()
178178
end
179179

180-
assert error.message =~ "Unable to read from device: %JasonVendored.DecodeError"
180+
assert error.message =~ "Unable to read from device: %JasonV.DecodeError"
181181

182182
File.close(pid)
183183
end
@@ -194,7 +194,7 @@ defmodule ElixirLS.Utils.PacketStreamTest do
194194
|> Enum.to_list()
195195
end
196196

197-
assert error.message =~ "Unable to read from device: %JasonVendored.DecodeError"
197+
assert error.message =~ "Unable to read from device: %JasonV.DecodeError"
198198

199199
File.close(pid)
200200
end

apps/elixir_ls_utils/test/support/mix_test.case.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ defmodule ElixirLS.Utils.MixTest.Case do
2626
dialyzer
2727
dialyxir_vendored
2828
erl2ex
29-
jason_vendored
29+
jason_v
3030
)a
3131

3232
setup do

apps/elixir_ls_utils/test/support/packet_capture.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ defmodule ElixirLS.Utils.PacketCapture do
4848

4949
defp extract_packet(str) do
5050
with [_header, body] <- String.split(str, "\r\n\r\n", parts: 2),
51-
{:ok, packet} <- JasonVendored.decode(body) do
51+
{:ok, packet} <- JasonV.decode(body) do
5252
packet
5353
else
5454
_ -> nil

apps/elixir_ls_utils/test/wire_protocol_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule ElixirLS.Utils.WireProtocolTest do
1616
assert captured == "Content-Length: 16\r\n\r\n{\"some\":\"value\"}"
1717
"Content-Length: 16\r\n\r\n" <> body = captured
1818
assert byte_size(body) == 16
19-
assert JasonVendored.decode!(body) == packet
19+
assert JasonV.decode!(body) == packet
2020
end
2121

2222
test "sends valid json with unicode" do
@@ -38,6 +38,6 @@ defmodule ElixirLS.Utils.WireProtocolTest do
3838
bytes = File.read!("#{@tmp_folder_path}/packet_stream")
3939
assert "Content-Length: 34\r\n\r\n" <> body = bytes
4040
assert byte_size(body) == 34
41-
assert JasonVendored.decode!(body) == packet
41+
assert JasonV.decode!(body) == packet
4242
end
4343
end

apps/language_server/lib/language_server/build.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ defmodule ElixirLS.LanguageServer.Build do
272272
:elixir_ls_utils,
273273
:elixir_sense,
274274
:stream_data,
275-
:jason_vendored,
275+
:jason_v,
276276
:path_glob_vendored,
277277
:dialyxir_vendored,
278278
:erl2ex,

apps/language_server/lib/language_server/experimental/protocol/proto/macros/json.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defmodule ElixirLS.LanguageServer.Experimental.Protocol.Proto.Macros.Json do
33

44
def build(dest_module) do
55
quote location: :keep do
6-
defimpl JasonVendored.Encoder, for: unquote(dest_module) do
6+
defimpl JasonV.Encoder, for: unquote(dest_module) do
77
def encode(%struct_module{} = value, opts) do
88
encoded_pairs =
99
for {field_name, field_type} <- unquote(dest_module).__meta__(:types),
@@ -19,7 +19,7 @@ defmodule ElixirLS.LanguageServer.Experimental.Protocol.Proto.Macros.Json do
1919
{:.., value} when is_map(value) -> Enum.to_list(value)
2020
{k, v} -> [{camelize(k), v}]
2121
end)
22-
|> JasonVendored.Encode.keyword(opts)
22+
|> JasonV.Encode.keyword(opts)
2323
end
2424

2525
defp get_field_value(%struct_module{} = struct, :..) do

0 commit comments

Comments
 (0)