Skip to content

Commit

Permalink
try to load tables on process start if project dir is already set
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Nov 13, 2023
1 parent 57645e1 commit 6805f89
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion apps/language_server/lib/language_server/tracer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,21 @@ defmodule ElixirLS.LanguageServer.Tracer do
])
end

{:ok, %{project_dir: nil}}
project_dir = :persistent_term.get(:language_server_project_dir, nil)
state = %{project_dir: project_dir}

if project_dir != nil do
{us, _} =
:timer.tc(fn ->
for table <- @tables do
init_table(table, project_dir)
end
end)

Logger.info("Loaded DETS databases in #{div(us, 1000)}ms")
end

{:ok, state}
end

@impl true
Expand Down

0 comments on commit 6805f89

Please sign in to comment.