Skip to content

Commit

Permalink
Fix crash on hover when project_dir is nil
Browse files Browse the repository at this point in the history
Fixes #719
  • Loading branch information
lukaszsamson committed Sep 29, 2022
1 parent 1cf22ee commit a40581e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/language_server/lib/language_server/providers/hover.ex
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ defmodule ElixirLS.LanguageServer.Providers.Hover do

cond do
erlang_module?(subject) ->
# erlang moudle is not support now.
# TODO erlang module is currently not supported
""

true ->
Expand Down Expand Up @@ -162,6 +162,8 @@ defmodule ElixirLS.LanguageServer.Providers.Hover do
("Elixir." <> mod_name) |> String.to_atom() |> function_exported?(:__info__, 1)
end

defp third_dep?(source, nil), do: false

defp third_dep?(source, project_dir) do
prefix = project_dir <> "/deps"
String.starts_with?(source, prefix)
Expand Down

0 comments on commit a40581e

Please sign in to comment.