Skip to content

Commit 0f7e8ed

Browse files
committed
Fix format defaults and typo
1 parent 0fee808 commit 0f7e8ed

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
44
import ElixirLS.LanguageServer.RangeUtils
55
require Logger
66

7+
def format(source_file, uri, project_dir, mix_project?, opts \\ [])
8+
79
def format(
810
%SourceFile{} = source_file,
911
uri = "file:" <> _,
1012
project_dir,
1113
mix_project?,
12-
opts \\ []
14+
opts
1315
)
1416
when is_binary(project_dir) do
1517
file_path = SourceFile.Path.absolute_from_uri(uri, project_dir)
@@ -53,8 +55,8 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
5355
end
5456
end
5557

56-
# if project_dir is not set or schema is not file we format with default options
57-
def format(%SourceFile{} = source_file, _uri, _project_dir, _mix_project?, _opts \\ []) do
58+
# if project_dir is not set or scheme is not file we format with default options
59+
def format(%SourceFile{} = source_file, _uri, _project_dir, _mix_project?, _opts) do
5860
do_format(source_file, nil, [])
5961
end
6062

apps/language_server/lib/language_server/source_file.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ defmodule ElixirLS.LanguageServer.SourceFile do
237237

238238
@spec formatter_for(String.t(), String.t() | nil, boolean, keyword()) ::
239239
{:ok, {function | nil, keyword()}} | {:error, any}
240-
def formatter_for(uri = "file:" <> _, project_dir, mix_project?, opts \\ [])
240+
def formatter_for(uri, project_dir, mix_project?, opts \\ [])
241+
242+
def formatter_for(uri = "file:" <> _, project_dir, mix_project?, opts)
241243
when is_binary(project_dir) do
242244
path = __MODULE__.Path.from_uri(uri)
243245

0 commit comments

Comments
 (0)