File tree Expand file tree Collapse file tree
apps/language_server/lib/language_server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,9 +451,14 @@ defmodule ElixirLS.LanguageServer.Dialyzer do
451451 # info may not be available is when it has been stripped by the beam_lib
452452 # module, but that shouldn't be the case. More info:
453453 # 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
457462 end
458463
459464 defp dependent_modules ( modules , mod_deps , result \\ MapSet . new ( ) )
You can’t perform that action at this time.
0 commit comments