Skip to content

Commit

Permalink
fix regression on < 1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed May 4, 2024
1 parent ba0614c commit 1525d4e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/elixir_sense/core/state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1783,8 +1783,17 @@ defmodule ElixirSense.Core.State do
def no_alias_expansion(other), do: other

# defmodule Elixir.Alias
def alias_defmodule({:__aliases__, _, [Elixir, _ | _]}, module, state, env),
do: {module, state, env}
def alias_defmodule({:__aliases__, _, [Elixir, _]}, module, state, env) do
{module, state, env}
end

if Version.match?(System.version(), ">= 1.16.0-dev") do
# on elixir >= 1.16 no unaliasing is happening
# https://github.com/elixir-lang/elixir/issues/12456
def alias_defmodule({:__aliases__, _, [Elixir, _ | _]}, module, state, env) do
{module, state, env}
end
end

# defmodule Alias in root
def alias_defmodule({:__aliases__, _, _}, module, state, %{module: nil} = env),
Expand Down

0 comments on commit 1525d4e

Please sign in to comment.