Skip to content

Commit

Permalink
fix crash on invalid specs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Feb 20, 2024
1 parent d7b12a1 commit f34fd88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/elixir_sense/providers/suggestion/reducers/returns.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule ElixirSense.Providers.Suggestion.Reducers.Returns do

%State.SpecInfo{specs: info_specs} ->
for spec <- info_specs,
{:ok, {:@, _, [{_, _, [quoted]}]}} = Code.string_to_quoted(spec),
{:ok, {:@, _, [{_, _, [quoted]}]}} <- [Code.string_to_quoted(spec)],
return <- Introspection.get_returns_from_spec_ast(quoted) do
format_return(return)
end
Expand All @@ -49,7 +49,7 @@ defmodule ElixirSense.Providers.Suggestion.Reducers.Returns do

%State.SpecInfo{specs: info_specs} ->
for spec <- info_specs,
{:ok, {:@, _, [{_, _, [quoted]}]}} = Code.string_to_quoted(spec),
{:ok, {:@, _, [{_, _, [quoted]}]}} <- [Code.string_to_quoted(spec)],
return <- Introspection.get_returns_from_spec_ast(quoted) do
format_return(return)
end
Expand Down

0 comments on commit f34fd88

Please sign in to comment.