Skip to content

Commit 4d9e023

Browse files
committed
do not crash when unable to format param
1 parent 46a560d commit 4d9e023

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

apps/elixir_ls_utils/lib/completion_engine.ex

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,17 @@ defmodule ElixirLS.Utils.CompletionEngine do
11861186

11871187
# assume function head is first in code and last in metadata
11881188
head_params = Enum.at(info.params, -1)
1189-
args = head_params |> Enum.map(&Macro.to_string/1)
1189+
1190+
args =
1191+
head_params
1192+
|> Enum.map(fn arg ->
1193+
try do
1194+
Macro.to_string(arg)
1195+
rescue
1196+
_ -> "term"
1197+
end
1198+
end)
1199+
11901200
default_args = Introspection.count_defaults(head_params)
11911201

11921202
# TODO this is useless - we duplicate and then deduplicate

0 commit comments

Comments
 (0)