Skip to content

Commit 9542837

Browse files
committed
raise more informative error
1 parent dee25c8 commit 9542837

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,9 +1274,17 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do
12741274
end
12751275

12761276
defp item_to_json(item, idx, options) do
1277+
kind =
1278+
try do
1279+
completion_kind(item.kind)
1280+
rescue
1281+
_ ->
1282+
raise "unexpected kind #{inspect(item.kind)} in completion #{inspect(item)}"
1283+
end
1284+
12771285
json = %{
12781286
"label" => item.label,
1279-
"kind" => completion_kind(item.kind),
1287+
"kind" => kind,
12801288
"detail" => item.detail,
12811289
"documentation" => %{"value" => item.documentation || "", kind: "markdown"},
12821290
"labelDetails" => item.label_details,

0 commit comments

Comments
 (0)