Skip to content

Commit 5a72388

Browse files
committed
fix dialyzer error
1 parent f9725ef commit 5a72388

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
1414
{:ok, []}
1515
end
1616

17-
{:ok, opts} ->
18-
if should_format?(uri, project_dir, opts[:inputs]) do
19-
do_format(source_file, opts)
20-
else
21-
{:ok, []}
22-
end
23-
2417
:error ->
2518
{:error, :internal_error, "Unable to fetch formatter options"}
2619
end
@@ -35,11 +28,9 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
3528

3629
# if project_dir is not set or schema is not file: we format with default options
3730
def format(%SourceFile{} = source_file, _uri, _project_dir) do
38-
do_format(source_file)
31+
do_format(source_file, nil, [])
3932
end
4033

41-
defp do_format(%SourceFile{} = source_file, opts \\ []), do: do_format(source_file, nil, opts)
42-
4334
defp do_format(%SourceFile{text: text}, formatter, opts) do
4435
formatted = get_formatted(text, formatter, opts)
4536

apps/language_server/lib/language_server/source_file.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ defmodule ElixirLS.LanguageServer.SourceFile do
233233
"""
234234
end
235235

236-
@spec formatter_for(String.t()) :: {:ok, keyword()} | :error
236+
@spec formatter_for(String.t()) :: {:ok, {function | nil, keyword()}} | :error
237237
def formatter_for(uri = "file:" <> _) do
238238
path = __MODULE__.Path.from_uri(uri)
239239

0 commit comments

Comments
 (0)