Skip to content

Commit 3de597b

Browse files
committed
make mix project pruning more robust
Fixes #885
1 parent e54e2eb commit 3de597b

File tree

1 file changed

+12
-3
lines changed
  • apps/language_server/lib/language_server

1 file changed

+12
-3
lines changed

apps/language_server/lib/language_server/build.ex

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,18 @@ defmodule ElixirLS.LanguageServer.Build do
8080

8181
for {app, path} <- Mix.Project.deps_paths() do
8282
child_module =
83-
Mix.Project.in_project(app, path, [build_path: build_path], fn mix_project ->
84-
mix_project
85-
end)
83+
try do
84+
Mix.Project.in_project(app, path, [build_path: build_path], fn mix_project ->
85+
mix_project
86+
end)
87+
rescue
88+
e ->
89+
message = Exception.message(e)
90+
91+
Logger.warning(
92+
"Unable to prune mix project module for #{app}: #{inspect(e.__struct__)} #{message} #{Exception.format(:error, e, __STACKTRACE__)}"
93+
)
94+
end
8695

8796
if child_module do
8897
purge_module(child_module)

0 commit comments

Comments
 (0)