Skip to content

Commit 7d011e9

Browse files
committed
fix crash when diagnostic file is IO.chardata
1 parent c1d59c7 commit 7d011e9

File tree

1 file changed

+2
-3
lines changed
  • apps/language_server/lib/language_server/source_file

1 file changed

+2
-3
lines changed

apps/language_server/lib/language_server/source_file/path.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ defmodule ElixirLS.LanguageServer.SourceFile.Path do
5757
path |> expand(project_dir) |> convert_separators_to_native()
5858
end
5959

60-
def to_uri(path) when is_binary(path) do
60+
def to_uri(path) when not is_nil(path) do
6161
path =
6262
path
6363
|> expand()
@@ -66,8 +66,7 @@ defmodule ElixirLS.LanguageServer.SourceFile.Path do
6666
to_uri_impl(path)
6767
end
6868

69-
def to_uri(path, project_dir)
70-
when is_binary(path) and (is_binary(project_dir) or is_nil(project_dir)) do
69+
def to_uri(path, project_dir) when not is_nil(path) do
7170
path =
7271
if project_dir == nil do
7372
expand(path)

0 commit comments

Comments
 (0)