Skip to content

Commit 7dbd03a

Browse files
committed
format
1 parent 8645d64 commit 7dbd03a

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

apps/language_server/lib/language_server/providers/completion.ex

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -165,28 +165,30 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do
165165
|> sort_items()
166166

167167
# add trigger signatures to arity 0 if there are higher arity completions that would trigger
168-
commands = items
169-
|> Enum.filter(& &1.kind in [:function, :class])
170-
|> Enum.group_by(&{&1.kind, &1.label})
171-
|> Map.new(fn {key, values} ->
172-
command = Enum.find_value(values, & &1.command)
173-
{key, command}
174-
end)
168+
commands =
169+
items
170+
|> Enum.filter(&(&1.kind in [:function, :class]))
171+
|> Enum.group_by(&{&1.kind, &1.label})
172+
|> Map.new(fn {key, values} ->
173+
command = Enum.find_value(values, & &1.command)
174+
{key, command}
175+
end)
175176

176-
items = items
177-
|> Enum.map(fn
178-
%{command: nil, kind: kind} = item when kind in [:function, :class] ->
179-
command = commands[{kind, item.label}]
180-
if command do
181-
%{item |
182-
command: command,
183-
insert_text: "#{item.label}($1)$0"
184-
}
185-
else
177+
items =
178+
items
179+
|> Enum.map(fn
180+
%{command: nil, kind: kind} = item when kind in [:function, :class] ->
181+
command = commands[{kind, item.label}]
182+
183+
if command do
184+
%{item | command: command, insert_text: "#{item.label}($1)$0"}
185+
else
186+
item
187+
end
188+
189+
item ->
186190
item
187-
end
188-
item -> item
189-
end)
191+
end)
190192

191193
items_json =
192194
items
@@ -658,7 +660,7 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do
658660

659661
signature_help_supported? = Keyword.get(options, :signature_help_supported, false)
660662
signature_after_complete? = Keyword.get(options, :signature_after_complete, true)
661-
663+
662664
trigger_signature? = signature_help_supported? && arity > 1
663665

664666
command =

0 commit comments

Comments
 (0)