@@ -19,7 +19,14 @@ defmodule NextLSPrivate.DepTracer do
19
19
20
20
{ :ok , { _ , [ { ~c" Dbgi" , bin } ] } } = :beam_lib . chunks ( bytecode , [ ~c" Dbgi" ] )
21
21
22
- { :debug_info_v1 , _ , { _ , % { line: line , struct: struct } , _ } } = :erlang . binary_to_term ( bin )
22
+ { line , struct } =
23
+ case :erlang . binary_to_term ( bin ) do
24
+ { :debug_info_v1 , _ , { _ , % { anno: anno , struct: struct } , _ } } ->
25
+ { :erl_anno . line ( anno ) , struct }
26
+
27
+ { :debug_info_v1 , _ , { _ , % { line: line , struct: struct } , _ } } ->
28
+ { line , struct }
29
+ end
23
30
24
31
Process . send (
25
32
parent ,
@@ -125,11 +132,12 @@ defmodule NextLSPrivate.Tracer do
125
132
:ok
126
133
end
127
134
128
- def trace ( { type , meta , module , func , arity } , env ) when type in [ :remote_function , :remote_macro , :imported_macro ] do
135
+ def trace ( { type , meta , module , func , arity } , env )
136
+ when type in [ :remote_function , :remote_macro , :imported_macro , :imported_function ] do
129
137
parent = parent_pid ( )
130
138
131
139
condition =
132
- if Version . match? ( System . version ( ) , ">= 1.17.0-dev " ) do
140
+ if Version . match? ( System . version ( ) , ">= 1.17.0" ) do
133
141
is_nil ( meta [ :column ] )
134
142
else
135
143
type == :remote_macro && meta [ :closing ] [ :line ] != meta [ :line ]
@@ -193,7 +201,14 @@ defmodule NextLSPrivate.Tracer do
193
201
194
202
{ :ok , { _ , [ { ~c" Dbgi" , bin } ] } } = :beam_lib . chunks ( bytecode , [ ~c" Dbgi" ] )
195
203
196
- { :debug_info_v1 , _ , { _ , % { line: line , struct: struct } , _ } } = :erlang . binary_to_term ( bin )
204
+ { line , struct } =
205
+ case :erlang . binary_to_term ( bin ) do
206
+ { :debug_info_v1 , _ , { _ , % { anno: anno , struct: struct } , _ } } ->
207
+ { :erl_anno . line ( anno ) , struct }
208
+
209
+ { :debug_info_v1 , _ , { _ , % { line: line , struct: struct } , _ } } ->
210
+ { line , struct }
211
+ end
197
212
198
213
Process . send (
199
214
parent ,
@@ -1361,9 +1376,6 @@ if Version.match?(System.version(), ">= 1.17.0-dev") do
1361
1376
{ :function , module , fun } ->
1362
1377
expand_remote ( meta , module , fun , args , state , env )
1363
1378
1364
- :error ->
1365
- expand_local ( meta , fun , args , state , env )
1366
-
1367
1379
{ :error , _ } ->
1368
1380
expand_local ( meta , fun , args , state , env )
1369
1381
end
0 commit comments