Skip to content

Commit

Permalink
move processes to app supervisor
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Oct 30, 2023
1 parent ab416ec commit 874a226
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions apps/elixir_ls_debugger/lib/debugger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ defmodule ElixirLS.Debugger do
children =
if Mix.env() != :test do
[
BreakpointCondition,
{ModuleInfoCache, %{}},
{Server, name: Server}
]
else
Expand Down
2 changes: 0 additions & 2 deletions apps/elixir_ls_debugger/lib/debugger/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ defmodule ElixirLS.Debugger.Server do

@impl GenServer
def init(opts) do
{:ok, _} = BreakpointCondition.start_link([])
{:ok, _} = ModuleInfoCache.start_link(%{})
state = if opts[:output], do: %__MODULE__{output: opts[:output]}, else: %__MODULE__{}
{:ok, state}
end
Expand Down
4 changes: 3 additions & 1 deletion apps/elixir_ls_debugger/test/debugger_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule ElixirLS.Debugger.ServerTest do
# between the debugger's tests and the fixture project's tests. Expect to see output printed
# from both.

alias ElixirLS.Debugger.{Server, Protocol, BreakpointCondition}
alias ElixirLS.Debugger.{Server, Protocol, BreakpointCondition, ModuleInfoCache}
use ElixirLS.Utils.MixTest.Case, async: false
use Protocol

Expand All @@ -14,6 +14,8 @@ defmodule ElixirLS.Debugger.ServerTest do
{:ok, packet_capture} = ElixirLS.Utils.PacketCapture.start_link(self())
Process.group_leader(Process.whereis(ElixirLS.Debugger.Output), packet_capture)

{:ok, _} = start_supervised(BreakpointCondition)
{:ok, _} = start_supervised({ModuleInfoCache, %{}})
{:ok, server} = Server.start_link(name: Server)

on_exit(fn ->
Expand Down

0 comments on commit 874a226

Please sign in to comment.