Skip to content

Commit eade711

Browse files
committed
port upstream changes
1 parent 98b810c commit eade711

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

lib/elixir_sense/core/compiler.ex

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,22 +2476,27 @@ defmodule ElixirSense.Core.Compiler do
24762476
defp expand_multi_alias_call(kind, meta, base, refs, opts, state, env) do
24772477
{base_ref, state, env} = expand_without_aliases_report(base, state, env)
24782478

2479-
fun = fn
2480-
{:__aliases__, _, ref}, state, env ->
2481-
expand({kind, meta, [Module.concat([base_ref | ref]), opts]}, state, env)
2479+
if is_atom(base_ref) do
2480+
fun = fn
2481+
{:__aliases__, _, ref}, state, env ->
2482+
expand({kind, meta, [Module.concat([base_ref | ref]), opts]}, state, env)
24822483

2483-
ref, state, env when is_atom(ref) ->
2484-
expand({kind, meta, [Module.concat([base_ref, ref]), opts]}, state, env)
2484+
ref, state, env when is_atom(ref) ->
2485+
expand({kind, meta, [Module.concat([base_ref, ref]), opts]}, state, env)
24852486

2486-
other, s, e ->
2487-
# elixir raises here
2488-
# expected_compile_time_module
2489-
# we search for cursor
2490-
{_, s, _} = expand(other, s, e)
2491-
{other, s, e}
2492-
end
2487+
other, s, e ->
2488+
# elixir raises here
2489+
# expected_compile_time_module
2490+
# we search for cursor
2491+
{_, s, _} = expand(other, s, e)
2492+
{other, s, e}
2493+
end
24932494

2494-
map_fold(fun, state, env, refs)
2495+
map_fold(fun, state, env, refs)
2496+
else
2497+
# elixir raises invalid_alias here
2498+
{{kind, meta, []}, state, env}
2499+
end
24952500
end
24962501

24972502
defp overridable_name(name, count) when is_integer(count), do: :"#{name} (overridable #{count})"

0 commit comments

Comments
 (0)