File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
apps/language_server/lib/language_server Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -451,9 +451,14 @@ defmodule ElixirLS.LanguageServer.Dialyzer do
451
451
# info may not be available is when it has been stripped by the beam_lib
452
452
# module, but that shouldn't be the case. More info:
453
453
# http://erlang.org/doc/reference_manual/modules.html#module_info-0-and-module_info-1-functions
454
- module . module_info ( :compile )
455
- |> Keyword . get ( :source , fallback )
456
- |> Path . relative_to_cwd ( )
454
+ if Code . ensure_loaded? ( module ) do
455
+ module . module_info ( :compile )
456
+ |> Keyword . get ( :source , fallback )
457
+ |> Path . relative_to_cwd ( )
458
+ else
459
+ # In case the file fails to load return fallback
460
+ Path . relative_to_cwd ( fallback )
461
+ end
457
462
end
458
463
459
464
defp dependent_modules ( modules , mod_deps , result \\ MapSet . new ( ) )
You can’t perform that action at this time.
0 commit comments