Skip to content

Commit

Permalink
Bypass file_server for some file existence checks (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbaker authored Oct 19, 2020
1 parent eb8c927 commit eceed51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/language_server/lib/language_server/diagnostics.ex
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ defmodule ElixirLS.LanguageServer.Diagnostics do
defp file_path(file, root_path) do
path = Path.join([root_path, file])

if File.exists?(path) do
if File.exists?(path, [:raw]) do
{:ok, path}
else
file_path_in_umbrella(file, root_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ defmodule ElixirLS.LanguageServer.Providers.WorkspaceSymbols do
with true <- Code.ensure_loaded?(module),
path when not is_nil(path) <- module.module_info(:compile)[:source],
path_binary = List.to_string(path),
true <- File.exists?(path_binary) do
true <- File.exists?(path_binary, [:raw]) do
path_binary
else
_ -> nil
Expand All @@ -265,7 +265,7 @@ defmodule ElixirLS.LanguageServer.Providers.WorkspaceSymbols do
with beam_file when not is_nil(beam_file) <-
ErlangSourceFile.get_beam_file(module, beam_file),
erl_file = ErlangSourceFile.beam_file_to_erl_file(beam_file),
true <- File.exists?(erl_file) do
true <- File.exists?(erl_file, [:raw]) do
erl_file
else
_ -> nil
Expand Down

0 comments on commit eceed51

Please sign in to comment.