Skip to content

Commit

Permalink
make mix project pruning more robust
Browse files Browse the repository at this point in the history
Fixes #885
  • Loading branch information
lukaszsamson committed Aug 8, 2023
1 parent e54e2eb commit 3de597b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions apps/language_server/lib/language_server/build.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,18 @@ defmodule ElixirLS.LanguageServer.Build do

for {app, path} <- Mix.Project.deps_paths() do
child_module =
Mix.Project.in_project(app, path, [build_path: build_path], fn mix_project ->
mix_project
end)
try do
Mix.Project.in_project(app, path, [build_path: build_path], fn mix_project ->
mix_project
end)
rescue
e ->
message = Exception.message(e)

Logger.warning(
"Unable to prune mix project module for #{app}: #{inspect(e.__struct__)} #{message} #{Exception.format(:error, e, __STACKTRACE__)}"
)
end

if child_module do
purge_module(child_module)
Expand Down

1 comment on commit 3de597b

@apoorv-2204
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @lukaszsamson

Please sign in to comment.