File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
apps/language_server/lib/language_server Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,15 @@ defmodule ElixirLS.LanguageServer.Build do
76
76
& Diagnostics . from_mix_task_compiler_diagnostic ( & 1 , mixfile , root_path )
77
77
)
78
78
79
+ if status == :ok do
80
+ # reload apps to make sure app controller has the correct list of modules
81
+ # if we don't do that, workspace symbols and other providers relying on
82
+ # `:application.get_key(app, :modules)` would not notice newly added modules
83
+ # no need to do that on :noop and :error
84
+ # workaround for https://github.com/elixir-lang/elixir/issues/13001
85
+ unload_mix_project_apps ( true )
86
+ end
87
+
79
88
Server . build_finished (
80
89
parent ,
81
90
{ status , mixfile_diagnostics ++ deps_diagnostics ++ compile_diagnostics }
@@ -569,7 +578,7 @@ defmodule ElixirLS.LanguageServer.Build do
569
578
end
570
579
end
571
580
572
- defp unload_mix_project_apps ( ) do
581
+ defp unload_mix_project_apps ( reload? \\ false ) do
573
582
# note that this will unload config so we need to call loadconfig afterwards
574
583
mix_project_apps =
575
584
if Mix.Project . umbrella? ( ) do
@@ -588,6 +597,13 @@ defmodule ElixirLS.LanguageServer.Build do
588
597
# see https://github.com/elixir-lang/elixir/issues/13001
589
598
for app <- mix_project_apps do
590
599
purge_app ( app , false )
600
+ if reload? do
601
+ case Application . load ( app ) do
602
+ :ok -> :ok
603
+ { :error , reason } ->
604
+ Logger . warning ( "Application #{ app } failed to load: #{ inspect ( reason ) } " )
605
+ end
606
+ end
591
607
end
592
608
end
593
609
You can’t perform that action at this time.
0 commit comments