Skip to content

Commit 7abb79e

Browse files
committed
add comments
1 parent 997f2ac commit 7abb79e

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

apps/language_server/lib/language_server/dialyzer.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ defmodule ElixirLS.LanguageServer.Dialyzer do
491491

492492
defp in_project?(path, project_dir) do
493493
# TODO return false for deps Mix.Project.config()[:deps_path]
494+
# project_dir is absolute path with universal separators
495+
# Path.absname result likewise
494496
File.exists?(path) and SourceFile.Path.path_in_dir?(Path.absname(path), project_dir)
495497
end
496498

apps/language_server/lib/language_server/providers/formatting.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
77
def format(%SourceFile{} = source_file, uri = "file:" <> _, project_dir)
88
when is_binary(project_dir) do
99
file_path = SourceFile.Path.absolute_from_uri(uri)
10-
10+
# file_path and project_dir are absolute paths with universal separators
1111
if SourceFile.Path.path_in_dir?(file_path, project_dir) do
1212
# file in project_dir we find formatter and options for file
1313
case SourceFile.formatter_for(uri, project_dir) do

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ defmodule ElixirLS.LanguageServer.SourceFile.Path do
117117
:os.type()
118118
end
119119

120+
# This function expects absolute paths with universal separators
120121
def path_in_dir?(file, dir) do
121122
case String.starts_with?(file, dir) do
122123
true ->

0 commit comments

Comments
 (0)