Skip to content

Commit 4011f4e

Browse files
committed
unload mix project apps before loading config
if we unload after loading config mix compile fails on Application.compile_env Fixes #1008
1 parent 5ce4c0a commit 4011f4e

File tree

1 file changed

+5
-0
lines changed
  • apps/language_server/lib/language_server

1 file changed

+5
-0
lines changed

apps/language_server/lib/language_server/build.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ defmodule ElixirLS.LanguageServer.Build do
9898
end
9999
end
100100

101+
unload_mix_project_apps()
102+
101103
# FIXME: Private API
102104
Mix.Project.pop()
103105
purge_module(module)
@@ -401,7 +403,10 @@ defmodule ElixirLS.LanguageServer.Build do
401403
for dep <- current_deps do
402404
maybe_purge_dep(dep)
403405
end
406+
end
404407

408+
defp unload_mix_project_apps() do
409+
# note that this will unload config so we need to call loadconfig afterwards
405410
mix_project_apps =
406411
if Mix.Project.umbrella?() do
407412
Mix.Project.apps_paths() |> Enum.map(&elem(&1, 0))

0 commit comments

Comments
 (0)