Skip to content

Commit 73d9b0c

Browse files
committed
do not crash on invalid optional_callbacks
1 parent aec3b4a commit 73d9b0c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/elixir_sense/core/compiler.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,9 +1065,11 @@ defmodule ElixirSense.Core.Compiler do
10651065

10661066
{arg, state, env} = expand(arg, state, env)
10671067

1068-
state =
1068+
state = if Keyword.keyword?(arg) do
1069+
State.register_optional_callbacks(state, arg)
1070+
else
10691071
state
1070-
|> State.register_optional_callbacks(arg)
1072+
end
10711073

10721074
{{:@, meta, [{:optional_callbacks, doc_meta, [arg]}]}, state, env}
10731075
end

0 commit comments

Comments
 (0)