Skip to content

Commit 0840536

Browse files
davidanthoffgithub-actions[bot]
authored andcommitted
Format files using DocumentFormat
1 parent 3e54183 commit 0840536

File tree

8 files changed

+104
-108
lines changed

8 files changed

+104
-108
lines changed

src/DAPRPC/core.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ struct DAPError <: Exception
22
msg::AbstractString
33
end
44

5-
mutable struct DAPEndpoint{IOIn <: IO,IOOut <: IO}
5+
mutable struct DAPEndpoint{IOIn<:IO,IOOut<:IO}
66
pipe_in::IOIn
77
pipe_out::IOOut
88

@@ -21,7 +21,7 @@ mutable struct DAPEndpoint{IOIn <: IO,IOOut <: IO}
2121
seq::Int
2222
end
2323

24-
DAPEndpoint(pipe_in, pipe_out, err_handler = nothing) =
24+
DAPEndpoint(pipe_in, pipe_out, err_handler=nothing) =
2525
DAPEndpoint(pipe_in, pipe_out, Channel{Any}(Inf), Channel{Any}(Inf), Dict{String,Channel{Any}}(), err_handler, :idle, nothing, nothing, 0)
2626

2727
function write_transport_layer(stream, response)
@@ -166,9 +166,9 @@ function send_request(x::DAPEndpoint, method::AbstractString, params)
166166

167167
response = take!(response_channel)
168168

169-
if response["success"]=="true"
169+
if response["success"] == "true"
170170
return response["body"]
171-
elseif response["success"]=="false"
171+
elseif response["success"] == "false"
172172
error_message = response["message"]
173173
throw(DAPError(error_message))
174174
else
@@ -184,7 +184,7 @@ function get_next_message(endpoint::DAPEndpoint)
184184
return msg
185185
end
186186

187-
function Base.iterate(endpoint::DAPEndpoint, state = nothing)
187+
function Base.iterate(endpoint::DAPEndpoint, state=nothing)
188188
check_dead_endpoint!(endpoint)
189189

190190
try

src/DAPRPC/interface_def.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ end
2323

2424
function field_allows_missing(field::Expr)
2525
field.head == :(::) && field.args[2] isa Expr &&
26-
field.args[2].head == :curly && field.args[2].args[1] == :Union &&
27-
any(i -> i == :Missing, field.args[2].args)
26+
field.args[2].head == :curly && field.args[2].args[1] == :Union &&
27+
any(i -> i == :Missing, field.args[2].args)
2828
end
2929

3030
function field_type(field::Expr, typename::String)
@@ -55,9 +55,9 @@ macro dict_readable(arg)
5555
$((arg))
5656

5757
$(count_real_fields > 0 ? :(
58-
function $tname(; $((get_kwsignature_for_field(field) for field in arg.args[3].args if !(field isa LineNumberNode))...))
59-
$tname($((field.args[1] for field in arg.args[3].args if !(field isa LineNumberNode))...))
60-
end
58+
function $tname(; $((get_kwsignature_for_field(field) for field in arg.args[3].args if !(field isa LineNumberNode))...))
59+
$tname($((field.args[1] for field in arg.args[3].args if !(field isa LineNumberNode))...))
60+
end
6161
) : nothing)
6262

6363
function $tname(dict::Dict)

src/DAPRPC/typed.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ end
2929
# so that we get an error in the typecast at the end of `send`
3030
# if that is not the case.
3131
typed_res(res, TR::Type{Nothing}) = res
32-
typed_res(res, TR::Type{<:T}) where {T <: AbstractArray{Any}} = T(res)
32+
typed_res(res, TR::Type{<:T}) where {T<:AbstractArray{Any}} = T(res)
3333
typed_res(res, TR::Type{<:AbstractArray{T}}) where T = T.(res)
3434
typed_res(res, TR::Type) = TR(res)
3535

@@ -58,7 +58,7 @@ end
5858
function dispatch_msg(x::DAPEndpoint, dispatcher::MsgDispatcher, msg)
5959
dispatcher._currentlyHandlingMsg = true
6060
try
61-
method_name, request_type = if msg["type"] == "request"
61+
method_name, request_type = if msg["type"] == "request"
6262
msg["command"], :request
6363
elseif msg["type"] == "event"
6464
msg["event"], :event
@@ -81,7 +81,7 @@ function dispatch_msg(x::DAPEndpoint, dispatcher::MsgDispatcher, msg)
8181
param_type(msg[request_type == :request ? "arguments" : "body"])
8282
end
8383
elseif param_type <: NamedTuple
84-
convert(param_type,(;(Symbol(i[1])=>i[2] for i in msg[request_type == :request ? "arguments" : "body"])...))
84+
convert(param_type, (; (Symbol(i[1]) => i[2] for i in msg[request_type == :request ? "arguments" : "body"])...))
8585
else
8686
param_type(msg[request_type == :request ? "arguments" : "body"])
8787
end

src/DebugEngines.jl

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mutable struct DebugEngine
1010

1111
next_cmd::Channel{Any}
1212

13-
frame::Union{Nothing, JuliaInterpreter.Frame}
13+
frame::Union{Nothing,JuliaInterpreter.Frame}
1414

1515
expr_splitter::Union{JuliaInterpreter.ExprSplitter,Nothing}
1616

@@ -28,13 +28,9 @@ mutable struct DebugEngine
2828
mod,
2929
code,
3030
filename,
31-
stop_on_entry,
32-
33-
Channel{Any}(Inf),
34-
nothing,
31+
stop_on_entry, Channel{Any}(Inf),
3532
nothing,
36-
37-
JuliaInterpreter.finish_and_return!,
33+
nothing, JuliaInterpreter.finish_and_return!,
3834
String[],
3935
Set{Any}(),
4036
nothing,
@@ -43,7 +39,7 @@ mutable struct DebugEngine
4339
end
4440
end
4541

46-
function get_obj_by_accessor(accessor, super = nothing)
42+
function get_obj_by_accessor(accessor, super=nothing)
4743
parts = split(accessor, '.')
4844
@assert length(parts) > 0
4945
top = popfirst!(parts)
@@ -75,8 +71,8 @@ function get_obj_by_accessor(accessor, super = nothing)
7571
return nothing
7672
end
7773

78-
function toggle_mode_for_all_submodules(mod, compiled, seen = Set())
79-
for name in names(mod; all = true)
74+
function toggle_mode_for_all_submodules(mod, compiled, seen=Set())
75+
for name in names(mod; all=true)
8076
if isdefined(mod, name)
8177
obj = getfield(mod, name)
8278
if obj !== mod && obj isa Module && !(obj in seen)
@@ -112,7 +108,7 @@ function set_compiled_functions_modules!(debug_engine::DebugEngine, items::Vecto
112108
@debug "setting as compiled" items = items
113109

114110
# sort inputs once so that removed items are at the end
115-
sort!(items, lt = function (a, b)
111+
sort!(items, lt=function (a, b)
116112
am = startswith(a, '-')
117113
bm = startswith(b, '-')
118114

@@ -308,7 +304,7 @@ function Base.run(debug_engine::DebugEngine)
308304
elseif JuliaInterpreter.shouldbreak(debug_engine.frame, debug_engine.frame.pc)
309305
debug_engine.on_stop(StopReasonBreakpoint)
310306
else
311-
put!(debug_engine.next_cmd, (cmd = :continue,))
307+
put!(debug_engine.next_cmd, (cmd=:continue,))
312308
end
313309

314310

@@ -382,7 +378,7 @@ function Base.run(debug_engine::DebugEngine)
382378
end
383379

384380
function terminate(debug_engine::DebugEngine)
385-
put!(debug_engine.next_cmd, (cmd = :stop,))
381+
put!(debug_engine.next_cmd, (cmd=:stop,))
386382
end
387383

388384
function set_function_breakpoints!(debug_engine::DebugEngine, breakpoints)
@@ -406,23 +402,23 @@ function set_compiled_mode!(debug_engine::DebugEngine, compiled_mode::Bool)
406402
end
407403

408404
function execution_continue(debug_engine::DebugEngine)
409-
put!(debug_engine.next_cmd, (cmd = :continue,))
405+
put!(debug_engine.next_cmd, (cmd=:continue,))
410406
end
411407

412408
function execution_next(debug_engine::DebugEngine)
413-
put!(debug_engine.next_cmd, (cmd = :next,))
409+
put!(debug_engine.next_cmd, (cmd=:next,))
414410
end
415411

416412
function execution_step_in(debug_engine::DebugEngine, target_id)
417-
put!(debug_engine.next_cmd, (cmd = :stepIn, targetId = target_id))
413+
put!(debug_engine.next_cmd, (cmd=:stepIn, targetId=target_id))
418414
end
419415

420416
function execution_step_out(debug_engine::DebugEngine)
421-
put!(debug_engine.next_cmd, (cmd = :stepOut,))
417+
put!(debug_engine.next_cmd, (cmd=:stepOut,))
422418
end
423419

424420
function execution_terminate(debug_engine::DebugEngine)
425-
put!(debug_engine.next_cmd, (cmd = :stop,))
421+
put!(debug_engine.next_cmd, (cmd=:stop,))
426422
end
427423

428424
end

0 commit comments

Comments
 (0)