Skip to content

Commit 1f4f7e1

Browse files
committed
fix crash on surround context with dot and alias
1 parent 744c35f commit 1f4f7e1

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

lib/elixir_sense/core/options.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,10 @@ defmodule ElixirSense.Core.Options do
346346

347347
def do_expand_type({name, meta, args}, metadata, module, named_args, stack)
348348
when is_atom(name) do
349-
args = if(is_list(args), do: args, else: []) |> Enum.map(&expand_type(&1, metadata, module, named_args, stack))
349+
args =
350+
if(is_list(args), do: args, else: [])
351+
|> Enum.map(&expand_type(&1, metadata, module, named_args, stack))
352+
350353
named_arg = Keyword.fetch(named_args, name)
351354

352355
cond do

lib/elixir_sense/core/surround_context.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ defmodule ElixirSense.Core.SurroundContext do
2727
defp to_binding_impl({:alias, {:module_attribute, _charlist1}, _charlist}, _current_module),
2828
do: nil
2929

30+
# this probably only existed on 1.14
31+
defp to_binding_impl({:alias, {:dot, _, _}, _charlist}, _current_module),
32+
do: nil
33+
3034
defp to_binding_impl({:dot, inside_dot, charlist}, current_module) do
3135
{inside_dot_to_binding(inside_dot, current_module), :"#{charlist}"}
3236
end

lib/elixir_sense/core/type_info.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ defmodule ElixirSense.Core.TypeInfo do
235235
"Macro.to_string(#{inspect(sanitized)}) returned invalid code. If you believe this to be an error please report that to elixir project."
236236
)
237237
end
238+
238239
string
239240
end
240241

0 commit comments

Comments
 (0)