Skip to content

Commit

Permalink
call earlier versions on 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Aug 22, 2024
1 parent 2ebafdd commit 92914f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/elixir_sense/core/normalized/macro/env.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ defmodule ElixirSense.Core.Normalized.Macro.Env do
fn expansion_meta, args ->
quoted = expander.(args, env)
next = :elixir_module.next_counter(env.module)

if Version.match?(System.version(), ">= 1.14.0-dev") do
:elixir_quote.linify_with_context_counter(expansion_meta, {receiver, next}, quoted)
else
:elixir_quote.linify_with_context_counter(expansion_meta |> Keyword.get(:line, 0), {receiver, next}, quoted)
end
end
end

Expand Down Expand Up @@ -535,7 +540,11 @@ defmodule ElixirSense.Core.Normalized.Macro.Env do
_ ->
local =
allow_locals and
if Version.match?(System.version(), ">= 1.14.0-dev") do
:elixir_def.local_for(meta, name, arity, [:defmacro, :defmacrop], e)
else
:elixir_def.local_for(module, name, arity, [:defmacro, :defmacrop])
end

case dispatch do
{_, receiver} when local != false and receiver != module ->
Expand Down

0 comments on commit 92914f5

Please sign in to comment.