Skip to content

Commit

Permalink
unload mix project apps before loading config
Browse files Browse the repository at this point in the history
if we unload after loading config mix compile fails on Application.compile_env

Fixes #1008
  • Loading branch information
lukaszsamson committed Oct 20, 2023
1 parent 5ce4c0a commit 4011f4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/language_server/lib/language_server/build.ex
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ defmodule ElixirLS.LanguageServer.Build do
end
end

unload_mix_project_apps()

# FIXME: Private API
Mix.Project.pop()
purge_module(module)
Expand Down Expand Up @@ -401,7 +403,10 @@ defmodule ElixirLS.LanguageServer.Build do
for dep <- current_deps do
maybe_purge_dep(dep)
end
end

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

0 comments on commit 4011f4e

Please sign in to comment.