Skip to content

Commit a22ccea

Browse files
committed
fix crash on invalid locals_without_parens
1 parent c39c42e commit a22ccea

File tree

1 file changed

+11
-2
lines changed
  • apps/language_server/lib/language_server

1 file changed

+11
-2
lines changed

apps/language_server/lib/language_server/server.ex

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,8 +1104,17 @@ defmodule ElixirLS.LanguageServer.Server do
11041104

11051105
locals_without_parens =
11061106
case SourceFile.formatter_for(uri, state.project_dir, state.mix_project?) do
1107-
{:ok, {_, opts, _formatter_exs_dir}} -> Keyword.get(opts, :locals_without_parens, [])
1108-
{:error, _} -> []
1107+
{:ok, {_, opts, _formatter_exs_dir}} ->
1108+
locals_without_parens = Keyword.get(opts, :locals_without_parens, [])
1109+
1110+
if List.improper?(locals_without_parens) do
1111+
[]
1112+
else
1113+
locals_without_parens
1114+
end
1115+
1116+
{:error, _} ->
1117+
[]
11091118
end
11101119
|> MapSet.new()
11111120

0 commit comments

Comments
 (0)