@@ -21,7 +21,11 @@ defmodule ElixirLS.Debugger.Stacktrace do
21
21
22
22
def name ( % __MODULE__ { function: function } = frame ) when not is_nil ( function ) do
23
23
{ f , a } = frame . function
24
- "#{ inspect ( frame . module ) } .#{ f } /#{ a } "
24
+
25
+ case a do
26
+ :undefined -> "#{ inspect ( frame . module ) } .#{ f } /?"
27
+ _ -> "#{ inspect ( frame . module ) } .#{ f } /#{ a } "
28
+ end
25
29
end
26
30
27
31
def name ( % __MODULE__ { } = frame ) do
@@ -40,7 +44,7 @@ defmodule ElixirLS.Debugger.Stacktrace do
40
44
first_frame = % Frame {
41
45
level: level ,
42
46
module: module ,
43
- function: { function , Enum . count ( args ) } ,
47
+ function: { function , get_arity ( args ) } ,
44
48
args: args ,
45
49
file: get_file ( module ) ,
46
50
# vscode raises invalid request when line is nil
@@ -62,7 +66,7 @@ defmodule ElixirLS.Debugger.Stacktrace do
62
66
% Frame {
63
67
level: level ,
64
68
module: mod ,
65
- function: { function , Enum . count ( args ) } ,
69
+ function: { function , get_arity ( args ) } ,
66
70
args: args ,
67
71
file: get_file ( mod ) ,
68
72
# vscode raises invalid request when line is nil
@@ -107,4 +111,7 @@ defmodule ElixirLS.Debugger.Stacktrace do
107
111
def get_file ( module ) do
108
112
Path . expand ( to_string ( ModuleInfoCache . get ( module ) [ :compile ] [ :source ] ) )
109
113
end
114
+
115
+ defp get_arity ( :undefined ) , do: :undefined
116
+ defp get_arity ( args ) , do: Enum . count ( args )
110
117
end
0 commit comments