Skip to content

Commit

Permalink
check if loading apps is still needed
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Jun 2, 2022
1 parent ec1b31c commit d03cfe5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions apps/language_server/lib/language_server/build.ex
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,20 @@ defmodule ElixirLS.LanguageServer.Build do
[]
end

Enum.each(apps, fn app ->
true = Code.prepend_path(Path.join(Mix.Project.build_path(), "lib/#{app}/ebin"))

case Application.load(app) do
:ok -> :ok
{:error, {:already_loaded, _}} -> :ok
end
end)
# Enum.each(apps, fn app ->
# IO.inspect(Process.whereis(:user), app, label: "loading")
# mods_before = :code.all_loaded()
# IO.inspect(Process.whereis(:user), App2.Foo in Keyword.keys(mods_before), label: "Foo loaded", limit: :infinity)
# IO.inspect(Process.whereis(:user), Date in Keyword.keys(mods_before), label: "Date loaded", limit: :infinity)
# true = Code.prepend_path(Path.join(Mix.Project.build_path(), "lib/#{app}/ebin"))

# case Application.load(app) do
# :ok -> :ok
# {:error, {:already_loaded, _}} -> :ok
# end
# mods_after = :code.all_loaded()
# IO.inspect(Process.whereis(:user), App2.Foo in Keyword.keys(mods_after), label: "Foo loaded")
# end)
end

defp compile do
Expand Down

0 comments on commit d03cfe5

Please sign in to comment.