@@ -19,7 +19,14 @@ defmodule NextLSPrivate.DepTracer do
1919
2020 { :ok , { _ , [ { ~c" Dbgi" , bin } ] } } = :beam_lib . chunks ( bytecode , [ ~c" Dbgi" ] )
2121
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
2330
2431 Process . send (
2532 parent ,
@@ -125,11 +132,12 @@ defmodule NextLSPrivate.Tracer do
125132 :ok
126133 end
127134
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
129137 parent = parent_pid ( )
130138
131139 condition =
132- if Version . match? ( System . version ( ) , ">= 1.17.0-dev " ) do
140+ if Version . match? ( System . version ( ) , ">= 1.17.0" ) do
133141 is_nil ( meta [ :column ] )
134142 else
135143 type == :remote_macro && meta [ :closing ] [ :line ] != meta [ :line ]
@@ -193,7 +201,14 @@ defmodule NextLSPrivate.Tracer do
193201
194202 { :ok , { _ , [ { ~c" Dbgi" , bin } ] } } = :beam_lib . chunks ( bytecode , [ ~c" Dbgi" ] )
195203
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
197212
198213 Process . send (
199214 parent ,
@@ -1361,9 +1376,6 @@ if Version.match?(System.version(), ">= 1.17.0-dev") do
13611376 { :function , module , fun } ->
13621377 expand_remote ( meta , module , fun , args , state , env )
13631378
1364- :error ->
1365- expand_local ( meta , fun , args , state , env )
1366-
13671379 { :error , _ } ->
13681380 expand_local ( meta , fun , args , state , env )
13691381 end
0 commit comments