Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/debug_adapter/test/debugger_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
# ExUnit.CaptureLog seeing crash reports).
Logger.configure(level: :debug)

{:ok, packet_capture} = ElixirLS.Utils.PacketCapture.start_link(self())
{:ok, packet_capture} = ElixirLS.Utils.PacketCapture.start(self())
default_group_leader = Process.info(Process.whereis(Output))[:group_leader]
Process.group_leader(Process.whereis(Output), packet_capture)

Expand All @@ -49,6 +49,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
:ok
end
end

GenServer.stop(packet_capture)
end)

{:ok, %{server: server}}
Expand Down
3 changes: 2 additions & 1 deletion apps/debug_adapter/test/exunit_formatter_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule ElixirLS.DebugAdapter.ExUnitFormatterTest do
@test_file "/abs/project/test/example_test.exs"

setup do
{:ok, packet_capture} = PacketCapture.start_link(self())
{:ok, packet_capture} = PacketCapture.start(self())
output = Process.whereis(Output)
default_group_leader = Process.info(output)[:group_leader]
Process.group_leader(output, packet_capture)
Expand All @@ -21,6 +21,7 @@ defmodule ElixirLS.DebugAdapter.ExUnitFormatterTest do
on_exit(fn ->
Process.group_leader(Process.whereis(Output), default_group_leader)
if Process.alive?(formatter), do: GenServer.stop(formatter)
GenServer.stop(packet_capture)
end)

{:ok, %{formatter: formatter}}
Expand Down
8 changes: 8 additions & 0 deletions apps/elixir_ls_utils/test/support/packet_capture.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ defmodule ElixirLS.Utils.PacketCapture do
GenServer.start_link(__MODULE__, parent)
end

# Unlinked variant for capturing output of long-lived processes (e.g. the global
# `ElixirLS.DebugAdapter.Output`). A linked capture dies together with the test
# process, before `on_exit` callbacks get a chance to restore the group leader,
# and any write in that window kills the process using it as group leader.
def start(parent) do
GenServer.start(__MODULE__, parent)
end

## Server Callbacks

@impl GenServer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ defmodule ElixirLS.LanguageServer.Providers.Implementation.LocatorTest do
end
"""

# implementations are returned in module load order, which is not deterministic
[
%Location{type: :module, file: file1, line: line1, column: column1},
%Location{type: :module, file: file2, line: line2, column: column2}
] = Locator.implementations(buffer, 1, 32)
] = Locator.implementations(buffer, 1, 32) |> Enum.sort_by(&{&1.file, &1.line})

assert file1 =~ "language_server/test/support/example_behaviour.ex"

Expand Down
2 changes: 1 addition & 1 deletion dep_versions.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
elixir_sense: "9788101d0828a0d9303bcda3c2a0e768385f6d05",
elixir_sense: "a15a1f4b67da8a244036df174e2d2b80a24593b8",
dialyxir_vendored: "accfec9393079abc4a82b7e79a4997f59f085b67",
jason_v: "f1c10fa9c445cb9f300266122ef18671054b2330",
erl2ex_vendored: "04f93e55f46d35d0aa3c149616f2c7a6a1ad9311",
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"},
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
"dialyxir_vendored": {:git, "https://github.com/elixir-lsp/dialyxir.git", "accfec9393079abc4a82b7e79a4997f59f085b67", [ref: "accfec9393079abc4a82b7e79a4997f59f085b67"]},
"elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "9788101d0828a0d9303bcda3c2a0e768385f6d05", [ref: "9788101d0828a0d9303bcda3c2a0e768385f6d05"]},
"elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "a15a1f4b67da8a244036df174e2d2b80a24593b8", [ref: "a15a1f4b67da8a244036df174e2d2b80a24593b8"]},
"erl2ex_vendored": {:git, "https://github.com/elixir-lsp/erl2ex.git", "04f93e55f46d35d0aa3c149616f2c7a6a1ad9311", [ref: "04f93e55f46d35d0aa3c149616f2c7a6a1ad9311"]},
"erlex_vendored": {:git, "https://github.com/elixir-lsp/erlex.git", "50b8307f90451a5d0288fb239fb6405b5ca1f1a4", [ref: "50b8307f90451a5d0288fb239fb6405b5ca1f1a4"]},
"jason_v": {:git, "https://github.com/elixir-lsp/jason.git", "f1c10fa9c445cb9f300266122ef18671054b2330", [ref: "f1c10fa9c445cb9f300266122ef18671054b2330"]},
Expand Down
Loading