File tree Expand file tree Collapse file tree 3 files changed +4
-1
lines changed
apps/language_server/lib/language_server Expand file tree Collapse file tree 3 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -491,6 +491,8 @@ defmodule ElixirLS.LanguageServer.Dialyzer do
491
491
492
492
defp in_project? ( path , project_dir ) do
493
493
# TODO return false for deps Mix.Project.config()[:deps_path]
494
+ # project_dir is absolute path with universal separators
495
+ # Path.absname result likewise
494
496
File . exists? ( path ) and SourceFile.Path . path_in_dir? ( Path . absname ( path ) , project_dir )
495
497
end
496
498
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
7
7
def format ( % SourceFile { } = source_file , uri = "file:" <> _ , project_dir )
8
8
when is_binary ( project_dir ) do
9
9
file_path = SourceFile.Path . absolute_from_uri ( uri )
10
-
10
+ # file_path and project_dir are absolute paths with universal separators
11
11
if SourceFile.Path . path_in_dir? ( file_path , project_dir ) do
12
12
# file in project_dir we find formatter and options for file
13
13
case SourceFile . formatter_for ( uri , project_dir ) do
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ defmodule ElixirLS.LanguageServer.SourceFile.Path do
117
117
:os . type ( )
118
118
end
119
119
120
+ # This function expects absolute paths with universal separators
120
121
def path_in_dir? ( file , dir ) do
121
122
case String . starts_with? ( file , dir ) do
122
123
true ->
You can’t perform that action at this time.
0 commit comments