@@ -5,7 +5,7 @@ function run_notification(conn, state::DebuggerState, params::NamedTuple{(:progr
5
5
6
6
state. debug_mode = :launch
7
7
filename_to_debug = isabspath (params. program) ? params. program : joinpath (pwd (), params. program)
8
- put! (state. next_cmd, (cmd = :run , program = filename_to_debug))
8
+ put! (state. next_cmd, (cmd= :run , program= filename_to_debug))
9
9
end
10
10
11
11
function debug_notification (conn, state:: DebuggerState , params:: DebugArguments )
@@ -73,10 +73,10 @@ function exec_notification(conn, state::DebuggerState, params::ExecArguments)
73
73
state. sources[0 ] = params. code
74
74
75
75
@debug " setting source_path" file = params. file
76
- put! (state. next_cmd, (cmd = :set_source_path , source_path = params. file))
76
+ put! (state. next_cmd, (cmd= :set_source_path , source_path= params. file))
77
77
78
- params. compiledModulesOrFunctions != = missing && set_compiled_items_request (conn, state, (compiledModulesOrFunctions = params. compiledModulesOrFunctions,))
79
- params. compiledMode != = missing && set_compiled_mode_request (conn, state, (compiledMode = params. compiledMode,))
78
+ params. compiledModulesOrFunctions != = missing && set_compiled_items_request (conn, state, (compiledModulesOrFunctions= params. compiledModulesOrFunctions,))
79
+ params. compiledMode != = missing && set_compiled_mode_request (conn, state, (compiledMode= params. compiledMode,))
80
80
81
81
ex = Meta. parse (params. code)
82
82
state. expr_splitter = JuliaInterpreter. ExprSplitter (Main, ex) # TODO : line numbers ?
@@ -87,7 +87,7 @@ function exec_notification(conn, state::DebuggerState, params::ExecArguments)
87
87
elseif JuliaInterpreter. shouldbreak (state. frame, state. frame. pc)
88
88
JSONRPC. send (conn, stopped_notification_type, StoppedEventArguments (" breakpoint" , missing , 1 , missing , missing , missing ))
89
89
else
90
- put! (state. next_cmd, (cmd = :continue ,))
90
+ put! (state. next_cmd, (cmd= :continue ,))
91
91
end
92
92
end
93
93
@@ -125,7 +125,7 @@ function set_compiled_functions_modules!(items::Vector{String})
125
125
@debug " setting as compiled" items = items
126
126
127
127
# sort inputs once so that removed items are at the end
128
- sort! (items, lt = function (a, b)
128
+ sort! (items, lt= function (a, b)
129
129
am = startswith (a, ' -' )
130
130
bm = startswith (b, ' -' )
131
131
@@ -206,8 +206,8 @@ function set_compiled_functions_modules!(params)
206
206
return []
207
207
end
208
208
209
- function toggle_mode_for_all_submodules (mod, compiled, seen = Set ())
210
- for name in names (mod; all = true )
209
+ function toggle_mode_for_all_submodules (mod, compiled, seen= Set ())
210
+ for name in names (mod; all= true )
211
211
if isdefined (mod, name)
212
212
obj = getfield (mod, name)
213
213
if obj != = mod && obj isa Module && ! (obj in seen)
@@ -223,7 +223,7 @@ function toggle_mode_for_all_submodules(mod, compiled, seen = Set())
223
223
end
224
224
end
225
225
226
- function get_obj_by_accessor (accessor, super = nothing )
226
+ function get_obj_by_accessor (accessor, super= nothing )
227
227
parts = split (accessor, ' .' )
228
228
@assert length (parts) > 0
229
229
top = popfirst! (parts)
@@ -324,7 +324,7 @@ function set_function_break_points_request(conn, state::DebuggerState, params::S
324
324
parsed_name = Meta. parse (decoded_name)
325
325
326
326
if parsed_name isa Symbol
327
- return (mod = Main, name = parsed_name, signature = nothing , condition = parsed_condition)
327
+ return (mod= Main, name= parsed_name, signature= nothing , condition= parsed_condition)
328
328
elseif parsed_name isa Expr
329
329
if parsed_name. head == :.
330
330
# TODO Support this case
@@ -339,16 +339,16 @@ function set_function_break_points_request(conn, state::DebuggerState, params::S
339
339
end
340
340
if all_args_are_legit
341
341
342
- return (mod = Main, name = parsed_name. args[1 ], signature = map (j -> j. args[1 ], parsed_name. args[2 : end ]), condition = parsed_condition)
342
+ return (mod= Main, name= parsed_name. args[1 ], signature= map (j -> j. args[1 ], parsed_name. args[2 : end ]), condition= parsed_condition)
343
343
else
344
- return (mod = Main, name = parsed_name. args[1 ], signature = nothing , condition = parsed_condition)
344
+ return (mod= Main, name= parsed_name. args[1 ], signature= nothing , condition= parsed_condition)
345
345
end
346
346
else
347
- return (mod = Main, name = parsed_name. args[1 ], signature = nothing , condition = parsed_condition)
347
+ return (mod= Main, name= parsed_name. args[1 ], signature= nothing , condition= parsed_condition)
348
348
end
349
349
else
350
350
return nothing
351
- end
351
+ end
352
352
else
353
353
return nothing
354
354
end
@@ -473,7 +473,7 @@ function stack_trace_request(conn, state::DebuggerState, params::StackTraceArgum
473
473
else
474
474
src = copy (src)
475
475
end
476
- JuliaInterpreter. replace_coretypes! (src; rev = true )
476
+ JuliaInterpreter. replace_coretypes! (src; rev= true )
477
477
code = Base. invokelatest (JuliaInterpreter. framecode_lines, src)
478
478
479
479
state. sources[state. next_source_id] = join (code, ' \n ' )
@@ -509,29 +509,29 @@ function stack_trace_request(conn, state::DebuggerState, params::StackTraceArgum
509
509
# for code that is passed via the @enter or @run macros,
510
510
# and that code we have stored as source with id 0
511
511
push! (
512
- frames,
513
- StackFrame (
514
- id,
515
- meth_or_mod_name,
516
- Source (
517
- " REPL" ,
518
- missing ,
519
- 0 ,
520
- missing ,
521
- missing ,
522
- missing ,
523
- missing ,
524
- missing
525
- ),
526
- lineno,
512
+ frames,
513
+ StackFrame (
514
+ id,
515
+ meth_or_mod_name,
516
+ Source (
517
+ " REPL" ,
518
+ missing ,
527
519
0 ,
528
520
missing ,
529
521
missing ,
530
522
missing ,
531
523
missing ,
532
524
missing
533
- )
525
+ ),
526
+ lineno,
527
+ 0 ,
528
+ missing ,
529
+ missing ,
530
+ missing ,
531
+ missing ,
532
+ missing
534
533
)
534
+ )
535
535
end
536
536
537
537
id += 1
@@ -569,17 +569,17 @@ function scopes_request(conn, state::DebuggerState, params::ScopesArguments)
569
569
scopes = []
570
570
571
571
if isfile (file_name) && code_range != = nothing
572
- push! (scopes, Scope (name = " Local" , variablesReference = local_var_ref_id, expensive = false , source = Source (name = basename (file_name), path = file_name), line = code_range. start, endLine = code_range. stop))
573
- push! (scopes, Scope (name = " Global" , variablesReference = global_var_ref_id, expensive = false , source = Source (name = basename (file_name), path = file_name), line = code_range. start, endLine = code_range. stop))
572
+ push! (scopes, Scope (name= " Local" , variablesReference= local_var_ref_id, expensive= false , source= Source (name= basename (file_name), path= file_name), line= code_range. start, endLine= code_range. stop))
573
+ push! (scopes, Scope (name= " Global" , variablesReference= global_var_ref_id, expensive= false , source= Source (name= basename (file_name), path= file_name), line= code_range. start, endLine= code_range. stop))
574
574
else
575
- push! (scopes, Scope (name = " Local" , variablesReference = local_var_ref_id, expensive = false ))
576
- push! (scopes, Scope (name = " Global" , variablesReference = global_var_ref_id, expensive = false ))
575
+ push! (scopes, Scope (name= " Local" , variablesReference= local_var_ref_id, expensive= false ))
576
+ push! (scopes, Scope (name= " Global" , variablesReference= global_var_ref_id, expensive= false ))
577
577
end
578
578
579
579
curr_mod = JuliaInterpreter. moduleof (curr_fr)
580
580
push! (state. varrefs, VariableReference (:module , curr_mod))
581
581
582
- push! (scopes, Scope (name = " Global ($(curr_mod) )" , variablesReference = length (state. varrefs), expensive = true ))
582
+ push! (scopes, Scope (name= " Global ($(curr_mod) )" , variablesReference= length (state. varrefs), expensive= true ))
583
583
584
584
return ScopesResponseArguments (scopes)
585
585
end
@@ -597,7 +597,7 @@ function construct_return_msg_for_var(state::DebuggerState, name, value)
597
597
v_value_as_string = try
598
598
Base. invokelatest (sprintlimited, value)
599
599
catch err
600
- @debug " error showing value" exception= (err, catch_backtrace ())
600
+ @debug " error showing value" exception = (err, catch_backtrace ())
601
601
" Error while showing this value."
602
602
end
603
603
@@ -609,7 +609,7 @@ function construct_return_msg_for_var(state::DebuggerState, name, value)
609
609
0
610
610
elseif value isa AbstractArray || value isa AbstractDict
611
611
fieldcount (v_type) > 0 ? 1 : 0
612
- else
612
+ else
613
613
fieldcount (v_type)
614
614
end
615
615
@@ -623,22 +623,22 @@ function construct_return_msg_for_var(state::DebuggerState, name, value)
623
623
end
624
624
625
625
return Variable (
626
- name = name,
627
- value = v_value_as_string,
628
- type = string (v_type),
629
- variablesReference = new_var_id,
630
- namedVariables = named_count,
631
- indexedVariables = indexed_count
626
+ name= name,
627
+ value= v_value_as_string,
628
+ type= string (v_type),
629
+ variablesReference= new_var_id,
630
+ namedVariables= named_count,
631
+ indexedVariables= indexed_count
632
632
)
633
633
else
634
- return Variable (name = name, value = v_value_as_string, type = string (v_type), variablesReference = 0 )
634
+ return Variable (name= name, value= v_value_as_string, type= string (v_type), variablesReference= 0 )
635
635
end
636
636
end
637
637
638
638
function construct_return_msg_for_var_with_undef_value (state:: DebuggerState , name)
639
639
v_type_as_string = " "
640
640
641
- return Variable (name = name, type = v_type_as_string, value = " #undef" , variablesReference = 0 )
641
+ return Variable (name= name, type= v_type_as_string, value= " #undef" , variablesReference= 0 )
642
642
end
643
643
644
644
function get_keys_with_drop_take (value, skip_count, take_count)
@@ -657,7 +657,7 @@ function collect_global_refs(frame::JuliaInterpreter.Frame)
657
657
func = frame. framedata. locals[1 ]. value
658
658
args = (Base. unwrap_unionall (m. sig). parameters[2 : end ]. .. ,)
659
659
660
- ci = code_typed (func, args, optimize = false )[1 ][1 ]
660
+ ci = code_typed (func, args, optimize= false )[1 ][1 ]
661
661
662
662
return collect_global_refs (ci)
663
663
catch err
@@ -666,14 +666,14 @@ function collect_global_refs(frame::JuliaInterpreter.Frame)
666
666
end
667
667
end
668
668
669
- function collect_global_refs (ci:: Core.CodeInfo , refs = Set ([]))
669
+ function collect_global_refs (ci:: Core.CodeInfo , refs= Set ([]))
670
670
for expr in ci. code
671
671
collect_global_refs (expr, refs)
672
672
end
673
673
refs
674
674
end
675
675
676
- function collect_global_refs (expr:: Expr , refs = Set ([]))
676
+ function collect_global_refs (expr:: Expr , refs= Set ([]))
677
677
args = Meta. isexpr (expr, :call ) ? expr. args[2 : end ] : expr. args
678
678
for arg in args
679
679
collect_global_refs (arg, refs)
@@ -686,12 +686,12 @@ collect_global_refs(expr, refs) = nothing
686
686
collect_global_refs (expr:: GlobalRef , refs) = push! (refs, expr)
687
687
688
688
function push_module_names! (variables, state, mod)
689
- for n in names (mod, all = true )
689
+ for n in names (mod, all= true )
690
690
! isdefined (mod, n) && continue
691
691
Base. isdeprecated (mod, n) && continue
692
692
693
693
x = getfield (mod, n)
694
- x === Main && continue
694
+ x === Main && continue
695
695
696
696
s = string (n)
697
697
startswith (s, " #" ) && continue
@@ -746,7 +746,7 @@ function variables_request(conn, state::DebuggerState, params::VariablesArgument
746
746
747
747
if filter_type == " " || filter_type == " named"
748
748
if (var_ref. value isa AbstractArray || var_ref. value isa AbstractDict) && ! (var_ref. value isa Array) &&
749
- fieldcount (container_type) > 0
749
+ fieldcount (container_type) > 0
750
750
push! (state. varrefs, VariableReference (:fields , var_ref. value))
751
751
new_var_id = length (state. varrefs)
752
752
named_count = fieldcount (container_type)
@@ -788,7 +788,7 @@ function variables_request(conn, state::DebuggerState, params::VariablesArgument
788
788
val = Base. invokelatest (getindex, var_ref. value, i)
789
789
s = construct_return_msg_for_var (state, join (string .(i. I), ' ,' ), val)
790
790
catch err
791
- s = Variable (name = join (string .(i. I), ' ,' ), type = " " , value = " #error" , variablesReference = 0 )
791
+ s = Variable (name= join (string .(i. I), ' ,' ), type= " " , value= " #error" , variablesReference= 0 )
792
792
end
793
793
push! (variables, s)
794
794
end
@@ -871,7 +871,7 @@ function set_variable_request(conn, state::DebuggerState, params::SetVariableArg
871
871
872
872
if var_ref. kind == :scope
873
873
try
874
- ret = JuliaInterpreter. eval_code (var_ref. value, " $var_name = $var_value " );
874
+ ret = JuliaInterpreter. eval_code (var_ref. value, " $var_name = $var_value " )
875
875
876
876
s = construct_return_msg_for_var (state:: DebuggerState , " " , ret)
877
877
@@ -950,7 +950,7 @@ function restart_frame_request(conn, state::DebuggerState, params::RestartFrameA
950
950
951
951
curr_fr = JuliaInterpreter. leaf (state. frame)
952
952
953
- i = 1
953
+ i = 1
954
954
955
955
while frame_id > i
956
956
curr_fr = curr_fr. caller
@@ -969,7 +969,7 @@ function restart_frame_request(conn, state::DebuggerState, params::RestartFrameA
969
969
state. frame = curr_fr
970
970
end
971
971
972
- put! (state. next_cmd, (cmd = :continue ,))
972
+ put! (state. next_cmd, (cmd= :continue ,))
973
973
974
974
return RestartFrameResponseResponseArguments ()
975
975
end
@@ -1007,31 +1007,31 @@ function evaluate_request(conn, state::DebuggerState, params::EvaluateArguments)
1007
1007
1008
1008
return EvaluateResponseArguments (Base. invokelatest (sprintlimited, ret_val), missing , missing , 0 , missing , missing , missing )
1009
1009
catch err
1010
- @debug " error showing value" exception= (err, catch_backtrace ())
1010
+ @debug " error showing value" exception = (err, catch_backtrace ())
1011
1011
return EvaluateResponseArguments (string (" Internal Error: " , sprint (showerror, err)), missing , missing , 0 , missing , missing , missing )
1012
1012
end
1013
1013
end
1014
1014
1015
- function continue_request (conn, state:: DebuggerState , params:: ContinueArguments )
1015
+ function continue_request (conn, state:: DebuggerState , params:: ContinueArguments )
1016
1016
@debug " continue_request"
1017
1017
1018
- put! (state. next_cmd, (cmd = :continue ,))
1018
+ put! (state. next_cmd, (cmd= :continue ,))
1019
1019
1020
1020
return ContinueResponseArguments (true )
1021
1021
end
1022
1022
1023
1023
function next_request (conn, state:: DebuggerState , params:: NextArguments )
1024
1024
@debug " next_request"
1025
1025
1026
- put! (state. next_cmd, (cmd = :next ,))
1026
+ put! (state. next_cmd, (cmd= :next ,))
1027
1027
1028
1028
return NextResponseArguments ()
1029
1029
end
1030
1030
1031
1031
function setp_in_request (conn, state:: DebuggerState , params:: StepInArguments )
1032
1032
@debug " stepin_request"
1033
1033
1034
- put! (state. next_cmd, (cmd = :stepIn , targetId = params. targetId))
1034
+ put! (state. next_cmd, (cmd= :stepIn , targetId= params. targetId))
1035
1035
1036
1036
return StepInResponseArguments ()
1037
1037
end
@@ -1049,15 +1049,15 @@ end
1049
1049
function setp_out_request (conn, state:: DebuggerState , params:: StepOutArguments )
1050
1050
@debug " stepout_request"
1051
1051
1052
- put! (state. next_cmd, (cmd = :stepOut ,))
1052
+ put! (state. next_cmd, (cmd= :stepOut ,))
1053
1053
1054
1054
return StepOutResponseArguments ()
1055
1055
end
1056
1056
1057
1057
function disconnect_request (conn, state:: DebuggerState , params:: DisconnectArguments )
1058
1058
@debug " disconnect_request"
1059
1059
1060
- put! (state. next_cmd, (cmd = :stop ,))
1060
+ put! (state. next_cmd, (cmd= :stop ,))
1061
1061
1062
1062
return DisconnectResponseArguments ()
1063
1063
end
@@ -1066,13 +1066,13 @@ function terminate_request(conn, state::DebuggerState, params::TerminateArgument
1066
1066
@debug " terminate_request"
1067
1067
1068
1068
JSONRPC. send (conn, finished_notification_type, nothing )
1069
- put! (state. next_cmd, (cmd = :stop ,))
1069
+ put! (state. next_cmd, (cmd= :stop ,))
1070
1070
1071
1071
return TerminateResponseArguments ()
1072
1072
end
1073
1073
1074
1074
function threads_request (conn, state:: DebuggerState , params:: Nothing )
1075
- return ThreadsResponseArguments ([Thread (id = 1 , name = " Main Thread" )])
1075
+ return ThreadsResponseArguments ([Thread (id= 1 , name= " Main Thread" )])
1076
1076
end
1077
1077
1078
1078
function breakpointlocations_request (conn, state:: DebuggerState , params:: BreakpointLocationsArguments )
0 commit comments