Skip to content

Commit 9793dd2

Browse files
authored
fix(index): better heuristic if a reference is from a macro (#499)
In Elixir >= 1.17, the meta will _not_ have a `:column` key if it is generated by a macro.
1 parent c4a6852 commit 9793dd2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

priv/monkey/_next_ls_private_compiler.ex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,14 @@ defmodule NextLSPrivate.Tracer do
128128
def trace({type, meta, module, func, arity}, env) when type in [:remote_function, :remote_macro, :imported_macro] do
129129
parent = parent_pid()
130130

131-
if type == :remote_macro && meta[:closing][:line] != meta[:line] do
131+
condition =
132+
if Version.match?(System.version(), ">= 1.17.0-dev") do
133+
is_nil(meta[:column])
134+
else
135+
type == :remote_macro && meta[:closing][:line] != meta[:line]
136+
end
137+
138+
if condition do
132139
# this is the case that a macro is getting expanded from inside
133140
# another macro expansion
134141
:noop

0 commit comments

Comments
 (0)