dap_types/requests.rs
1// This file is autogenerated. Do not edit by hand.
2// To regenerate from schema, run `cargo run -p generator`.
3
4use serde::{de::DeserializeOwned, Serialize};
5use std::fmt::Debug;
6
7/// Request is a request, with associated command, and argument and response types.
8pub trait Request {
9 const COMMAND: &'static str;
10 type Arguments: Debug + Clone + Serialize + DeserializeOwned + Send + Sync;
11 type Response: Debug + Clone + Serialize + DeserializeOwned + Send + Sync;
12}
13
14/// The `cancel` request is used by the client in two situations:
15/// - to indicate that it is no longer interested in the result produced by a specific request issued earlier
16/// - to cancel a progress sequence.
17/// Clients should only call this request if the corresponding capability `supportsCancelRequest` is true.
18/// This request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees.
19/// The `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users.
20/// The request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`).
21/// Returning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not.
22/// The progress that got cancelled still needs to send a `progressEnd` event back.
23/// A client should not assume that progress just got cancelled after sending the `cancel` request.
24pub enum Cancel {}
25
26impl Request for Cancel {
27 const COMMAND: &'static str = "cancel";
28 type Arguments = crate::CancelArguments;
29 type Response = ();
30}
31
32/// This request is sent from the debug adapter to the client to run a command in a terminal.
33/// This is typically used to launch the debuggee in a terminal provided by the client.
34/// This request should only be called if the corresponding client capability `supportsRunInTerminalRequest` is true.
35/// Client implementations of `runInTerminal` are free to run the command however they choose including issuing the command to a command line interpreter (aka 'shell'). Argument strings passed to the `runInTerminal` request must arrive verbatim in the command to be run. As a consequence, clients which use a shell are responsible for escaping any special shell characters in the argument strings to prevent them from being interpreted (and modified) by the shell.
36/// Some users may wish to take advantage of shell processing in the argument strings. For clients which implement `runInTerminal` using an intermediary shell, the `argsCanBeInterpretedByShell` property can be set to true. In this case the client is requested not to escape any special shell characters in the argument strings.
37pub enum RunInTerminal {}
38
39impl Request for RunInTerminal {
40 const COMMAND: &'static str = "runInTerminal";
41 type Arguments = crate::RunInTerminalRequestArguments;
42 type Response = crate::RunInTerminalResponse;
43}
44
45/// This request is sent from the debug adapter to the client to start a new debug session of the same type as the caller.
46/// This request should only be sent if the corresponding client capability `supportsStartDebuggingRequest` is true.
47/// A client implementation of `startDebugging` should start a new debug session (of the same type as the caller) in the same way that the caller's session was started. If the client supports hierarchical debug sessions, the newly created session can be treated as a child of the caller session.
48pub enum StartDebugging {}
49
50impl Request for StartDebugging {
51 const COMMAND: &'static str = "startDebugging";
52 type Arguments = crate::StartDebuggingRequestArguments;
53 type Response = ();
54}
55
56/// The `initialize` request is sent as the first request from the client to the debug adapter in order to configure it with client capabilities and to retrieve capabilities from the debug adapter.
57/// Until the debug adapter has responded with an `initialize` response, the client must not send any additional requests or events to the debug adapter.
58/// In addition the debug adapter is not allowed to send any requests or events to the client until it has responded with an `initialize` response.
59/// The `initialize` request may only be sent once.
60pub enum Initialize {}
61
62impl Request for Initialize {
63 const COMMAND: &'static str = "initialize";
64 type Arguments = crate::InitializeRequestArguments;
65 type Response = crate::Capabilities;
66}
67
68/// This request indicates that the client has finished initialization of the debug adapter.
69/// So it is the last request in the sequence of configuration requests (which was started by the `initialized` event).
70/// Clients should only call this request if the corresponding capability `supportsConfigurationDoneRequest` is true.
71pub enum ConfigurationDone {}
72
73impl Request for ConfigurationDone {
74 const COMMAND: &'static str = "configurationDone";
75 type Arguments = crate::ConfigurationDoneArguments;
76 type Response = ();
77}
78
79/// This launch request is sent from the client to the debug adapter to start the debuggee with or without debugging (if `noDebug` is true).
80/// Since launching is debugger/runtime specific, the arguments for this request are not part of this specification.
81pub enum Launch {}
82
83impl Request for Launch {
84 const COMMAND: &'static str = "launch";
85 type Arguments = crate::LaunchRequestArguments;
86 type Response = ();
87}
88
89/// The `attach` request is sent from the client to the debug adapter to attach to a debuggee that is already running.
90/// Since attaching is debugger/runtime specific, the arguments for this request are not part of this specification.
91pub enum Attach {}
92
93impl Request for Attach {
94 const COMMAND: &'static str = "attach";
95 type Arguments = crate::AttachRequestArguments;
96 type Response = ();
97}
98
99/// Restarts a debug session. Clients should only call this request if the corresponding capability `supportsRestartRequest` is true.
100/// If the capability is missing or has the value false, a typical client emulates `restart` by terminating the debug adapter first and then launching it anew.
101pub enum Restart {}
102
103impl Request for Restart {
104 const COMMAND: &'static str = "restart";
105 type Arguments = crate::RestartArguments;
106 type Response = ();
107}
108
109/// The `disconnect` request asks the debug adapter to disconnect from the debuggee (thus ending the debug session) and then to shut down itself (the debug adapter).
110/// In addition, the debug adapter must terminate the debuggee if it was started with the `launch` request. If an `attach` request was used to connect to the debuggee, then the debug adapter must not terminate the debuggee.
111/// This implicit behavior of when to terminate the debuggee can be overridden with the `terminateDebuggee` argument (which is only supported by a debug adapter if the corresponding capability `supportTerminateDebuggee` is true).
112pub enum Disconnect {}
113
114impl Request for Disconnect {
115 const COMMAND: &'static str = "disconnect";
116 type Arguments = crate::DisconnectArguments;
117 type Response = ();
118}
119
120/// The `terminate` request is sent from the client to the debug adapter in order to shut down the debuggee gracefully. Clients should only call this request if the capability `supportsTerminateRequest` is true.
121/// Typically a debug adapter implements `terminate` by sending a software signal which the debuggee intercepts in order to clean things up properly before terminating itself.
122/// Please note that this request does not directly affect the state of the debug session: if the debuggee decides to veto the graceful shutdown for any reason by not terminating itself, then the debug session just continues.
123/// Clients can surface the `terminate` request as an explicit command or they can integrate it into a two stage Stop command that first sends `terminate` to request a graceful shutdown, and if that fails uses `disconnect` for a forceful shutdown.
124pub enum Terminate {}
125
126impl Request for Terminate {
127 const COMMAND: &'static str = "terminate";
128 type Arguments = crate::TerminateArguments;
129 type Response = ();
130}
131
132/// The `breakpointLocations` request returns all possible locations for source breakpoints in a given range.
133/// Clients should only call this request if the corresponding capability `supportsBreakpointLocationsRequest` is true.
134pub enum BreakpointLocations {}
135
136impl Request for BreakpointLocations {
137 const COMMAND: &'static str = "breakpointLocations";
138 type Arguments = crate::BreakpointLocationsArguments;
139 type Response = crate::BreakpointLocationsResponse;
140}
141
142/// Sets multiple breakpoints for a single source and clears all previous breakpoints in that source.
143/// To clear all breakpoint for a source, specify an empty array.
144/// When a breakpoint is hit, a `stopped` event (with reason `breakpoint`) is generated.
145pub enum SetBreakpoints {}
146
147impl Request for SetBreakpoints {
148 const COMMAND: &'static str = "setBreakpoints";
149 type Arguments = crate::SetBreakpointsArguments;
150 type Response = crate::SetBreakpointsResponse;
151}
152
153/// Replaces all existing function breakpoints with new function breakpoints.
154/// To clear all function breakpoints, specify an empty array.
155/// When a function breakpoint is hit, a `stopped` event (with reason `function breakpoint`) is generated.
156/// Clients should only call this request if the corresponding capability `supportsFunctionBreakpoints` is true.
157pub enum SetFunctionBreakpoints {}
158
159impl Request for SetFunctionBreakpoints {
160 const COMMAND: &'static str = "setFunctionBreakpoints";
161 type Arguments = crate::SetFunctionBreakpointsArguments;
162 type Response = crate::SetFunctionBreakpointsResponse;
163}
164
165/// The request configures the debugger's response to thrown exceptions. Each of the `filters`, `filterOptions`, and `exceptionOptions` in the request are independent configurations to a debug adapter indicating a kind of exception to catch. An exception thrown in a program should result in a `stopped` event from the debug adapter (with reason `exception`) if any of the configured filters match.
166/// Clients should only call this request if the corresponding capability `exceptionBreakpointFilters` returns one or more filters.
167pub enum SetExceptionBreakpoints {}
168
169impl Request for SetExceptionBreakpoints {
170 const COMMAND: &'static str = "setExceptionBreakpoints";
171 type Arguments = crate::SetExceptionBreakpointsArguments;
172 type Response = crate::SetExceptionBreakpointsResponse;
173}
174
175/// Obtains information on a possible data breakpoint that could be set on an expression or variable.
176/// Clients should only call this request if the corresponding capability `supportsDataBreakpoints` is true.
177pub enum DataBreakpointInfo {}
178
179impl Request for DataBreakpointInfo {
180 const COMMAND: &'static str = "dataBreakpointInfo";
181 type Arguments = crate::DataBreakpointInfoArguments;
182 type Response = crate::DataBreakpointInfoResponse;
183}
184
185/// Replaces all existing data breakpoints with new data breakpoints.
186/// To clear all data breakpoints, specify an empty array.
187/// When a data breakpoint is hit, a `stopped` event (with reason `data breakpoint`) is generated.
188/// Clients should only call this request if the corresponding capability `supportsDataBreakpoints` is true.
189pub enum SetDataBreakpoints {}
190
191impl Request for SetDataBreakpoints {
192 const COMMAND: &'static str = "setDataBreakpoints";
193 type Arguments = crate::SetDataBreakpointsArguments;
194 type Response = crate::SetDataBreakpointsResponse;
195}
196
197/// Replaces all existing instruction breakpoints. Typically, instruction breakpoints would be set from a disassembly window.
198/// To clear all instruction breakpoints, specify an empty array.
199/// When an instruction breakpoint is hit, a `stopped` event (with reason `instruction breakpoint`) is generated.
200/// Clients should only call this request if the corresponding capability `supportsInstructionBreakpoints` is true.
201pub enum SetInstructionBreakpoints {}
202
203impl Request for SetInstructionBreakpoints {
204 const COMMAND: &'static str = "setInstructionBreakpoints";
205 type Arguments = crate::SetInstructionBreakpointsArguments;
206 type Response = crate::SetInstructionBreakpointsResponse;
207}
208
209/// The request resumes execution of all threads. If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true resumes only the specified thread. If not all threads were resumed, the `allThreadsContinued` attribute of the response should be set to false.
210pub enum Continue {}
211
212impl Request for Continue {
213 const COMMAND: &'static str = "continue";
214 type Arguments = crate::ContinueArguments;
215 type Response = crate::ContinueResponse;
216}
217
218/// The request executes one step (in the given granularity) for the specified thread and allows all other threads to run freely by resuming them.
219/// If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.
220/// The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.
221pub enum Next {}
222
223impl Request for Next {
224 const COMMAND: &'static str = "next";
225 type Arguments = crate::NextArguments;
226 type Response = ();
227}
228
229/// The request resumes the given thread to step into a function/method and allows all other threads to run freely by resuming them.
230/// If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.
231/// If the request cannot step into a target, `stepIn` behaves like the `next` request.
232/// The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.
233/// If there are multiple function/method calls (or other targets) on the source line,
234/// the argument `targetId` can be used to control into which target the `stepIn` should occur.
235/// The list of possible targets for a given source line can be retrieved via the `stepInTargets` request.
236pub enum StepIn {}
237
238impl Request for StepIn {
239 const COMMAND: &'static str = "stepIn";
240 type Arguments = crate::StepInArguments;
241 type Response = ();
242}
243
244/// The request resumes the given thread to step out (return) from a function/method and allows all other threads to run freely by resuming them.
245/// If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.
246/// The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.
247pub enum StepOut {}
248
249impl Request for StepOut {
250 const COMMAND: &'static str = "stepOut";
251 type Arguments = crate::StepOutArguments;
252 type Response = ();
253}
254
255/// The request executes one backward step (in the given granularity) for the specified thread and allows all other threads to run backward freely by resuming them.
256/// If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.
257/// The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.
258/// Clients should only call this request if the corresponding capability `supportsStepBack` is true.
259pub enum StepBack {}
260
261impl Request for StepBack {
262 const COMMAND: &'static str = "stepBack";
263 type Arguments = crate::StepBackArguments;
264 type Response = ();
265}
266
267/// The request resumes backward execution of all threads. If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true resumes only the specified thread. If not all threads were resumed, the `allThreadsContinued` attribute of the response should be set to false.
268/// Clients should only call this request if the corresponding capability `supportsStepBack` is true.
269pub enum ReverseContinue {}
270
271impl Request for ReverseContinue {
272 const COMMAND: &'static str = "reverseContinue";
273 type Arguments = crate::ReverseContinueArguments;
274 type Response = ();
275}
276
277/// The request restarts execution of the specified stack frame.
278/// The debug adapter first sends the response and then a `stopped` event (with reason `restart`) after the restart has completed.
279/// Clients should only call this request if the corresponding capability `supportsRestartFrame` is true.
280pub enum RestartFrame {}
281
282impl Request for RestartFrame {
283 const COMMAND: &'static str = "restartFrame";
284 type Arguments = crate::RestartFrameArguments;
285 type Response = ();
286}
287
288/// The request sets the location where the debuggee will continue to run.
289/// This makes it possible to skip the execution of code or to execute code again.
290/// The code between the current location and the goto target is not executed but skipped.
291/// The debug adapter first sends the response and then a `stopped` event with reason `goto`.
292/// Clients should only call this request if the corresponding capability `supportsGotoTargetsRequest` is true (because only then goto targets exist that can be passed as arguments).
293pub enum Goto {}
294
295impl Request for Goto {
296 const COMMAND: &'static str = "goto";
297 type Arguments = crate::GotoArguments;
298 type Response = ();
299}
300
301/// The request suspends the debuggee.
302/// The debug adapter first sends the response and then a `stopped` event (with reason `pause`) after the thread has been paused successfully.
303pub enum Pause {}
304
305impl Request for Pause {
306 const COMMAND: &'static str = "pause";
307 type Arguments = crate::PauseArguments;
308 type Response = ();
309}
310
311/// The request returns a stacktrace from the current execution state of a given thread.
312/// A client can request all stack frames by omitting the startFrame and levels arguments. For performance-conscious clients and if the corresponding capability `supportsDelayedStackTraceLoading` is true, stack frames can be retrieved in a piecemeal way with the `startFrame` and `levels` arguments. The response of the `stackTrace` request may contain a `totalFrames` property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of `totalFrames` decide how to proceed. In any case a client should be prepared to receive fewer frames than requested, which is an indication that the end of the stack has been reached.
313pub enum StackTrace {}
314
315impl Request for StackTrace {
316 const COMMAND: &'static str = "stackTrace";
317 type Arguments = crate::StackTraceArguments;
318 type Response = crate::StackTraceResponse;
319}
320
321/// The request returns the variable scopes for a given stack frame ID.
322pub enum Scopes {}
323
324impl Request for Scopes {
325 const COMMAND: &'static str = "scopes";
326 type Arguments = crate::ScopesArguments;
327 type Response = crate::ScopesResponse;
328}
329
330/// Retrieves all child variables for the given variable reference.
331/// A filter can be used to limit the fetched children to either named or indexed children.
332pub enum Variables {}
333
334impl Request for Variables {
335 const COMMAND: &'static str = "variables";
336 type Arguments = crate::VariablesArguments;
337 type Response = crate::VariablesResponse;
338}
339
340/// Set the variable with the given name in the variable container to a new value. Clients should only call this request if the corresponding capability `supportsSetVariable` is true.
341/// If a debug adapter implements both `setVariable` and `setExpression`, a client will only use `setExpression` if the variable has an `evaluateName` property.
342pub enum SetVariable {}
343
344impl Request for SetVariable {
345 const COMMAND: &'static str = "setVariable";
346 type Arguments = crate::SetVariableArguments;
347 type Response = crate::SetVariableResponse;
348}
349
350/// The request retrieves the source code for a given source reference.
351pub enum Source {}
352
353impl Request for Source {
354 const COMMAND: &'static str = "source";
355 type Arguments = crate::SourceArguments;
356 type Response = crate::SourceResponse;
357}
358
359/// The request retrieves a list of all threads.
360pub enum Threads {}
361
362impl Request for Threads {
363 const COMMAND: &'static str = "threads";
364 type Arguments = ();
365 type Response = crate::ThreadsResponse;
366}
367
368/// The request terminates the threads with the given ids.
369/// Clients should only call this request if the corresponding capability `supportsTerminateThreadsRequest` is true.
370pub enum TerminateThreads {}
371
372impl Request for TerminateThreads {
373 const COMMAND: &'static str = "terminateThreads";
374 type Arguments = crate::TerminateThreadsArguments;
375 type Response = ();
376}
377
378/// Modules can be retrieved from the debug adapter with this request which can either return all modules or a range of modules to support paging.
379/// Clients should only call this request if the corresponding capability `supportsModulesRequest` is true.
380pub enum Modules {}
381
382impl Request for Modules {
383 const COMMAND: &'static str = "modules";
384 type Arguments = crate::ModulesArguments;
385 type Response = crate::ModulesResponse;
386}
387
388/// Retrieves the set of all sources currently loaded by the debugged process.
389/// Clients should only call this request if the corresponding capability `supportsLoadedSourcesRequest` is true.
390pub enum LoadedSources {}
391
392impl Request for LoadedSources {
393 const COMMAND: &'static str = "loadedSources";
394 type Arguments = crate::LoadedSourcesArguments;
395 type Response = crate::LoadedSourcesResponse;
396}
397
398/// Evaluates the given expression in the context of the topmost stack frame.
399/// The expression has access to any variables and arguments that are in scope.
400pub enum Evaluate {}
401
402impl Request for Evaluate {
403 const COMMAND: &'static str = "evaluate";
404 type Arguments = crate::EvaluateArguments;
405 type Response = crate::EvaluateResponse;
406}
407
408/// Evaluates the given `value` expression and assigns it to the `expression` which must be a modifiable l-value.
409/// The expressions have access to any variables and arguments that are in scope of the specified frame.
410/// Clients should only call this request if the corresponding capability `supportsSetExpression` is true.
411/// If a debug adapter implements both `setExpression` and `setVariable`, a client uses `setExpression` if the variable has an `evaluateName` property.
412pub enum SetExpression {}
413
414impl Request for SetExpression {
415 const COMMAND: &'static str = "setExpression";
416 type Arguments = crate::SetExpressionArguments;
417 type Response = crate::SetExpressionResponse;
418}
419
420/// This request retrieves the possible step-in targets for the specified stack frame.
421/// These targets can be used in the `stepIn` request.
422/// Clients should only call this request if the corresponding capability `supportsStepInTargetsRequest` is true.
423pub enum StepInTargets {}
424
425impl Request for StepInTargets {
426 const COMMAND: &'static str = "stepInTargets";
427 type Arguments = crate::StepInTargetsArguments;
428 type Response = crate::StepInTargetsResponse;
429}
430
431/// This request retrieves the possible goto targets for the specified source location.
432/// These targets can be used in the `goto` request.
433/// Clients should only call this request if the corresponding capability `supportsGotoTargetsRequest` is true.
434pub enum GotoTargets {}
435
436impl Request for GotoTargets {
437 const COMMAND: &'static str = "gotoTargets";
438 type Arguments = crate::GotoTargetsArguments;
439 type Response = crate::GotoTargetsResponse;
440}
441
442/// Returns a list of possible completions for a given caret position and text.
443/// Clients should only call this request if the corresponding capability `supportsCompletionsRequest` is true.
444pub enum Completions {}
445
446impl Request for Completions {
447 const COMMAND: &'static str = "completions";
448 type Arguments = crate::CompletionsArguments;
449 type Response = crate::CompletionsResponse;
450}
451
452/// Retrieves the details of the exception that caused this event to be raised.
453/// Clients should only call this request if the corresponding capability `supportsExceptionInfoRequest` is true.
454pub enum ExceptionInfo {}
455
456impl Request for ExceptionInfo {
457 const COMMAND: &'static str = "exceptionInfo";
458 type Arguments = crate::ExceptionInfoArguments;
459 type Response = crate::ExceptionInfoResponse;
460}
461
462/// Reads bytes from memory at the provided location.
463/// Clients should only call this request if the corresponding capability `supportsReadMemoryRequest` is true.
464pub enum ReadMemory {}
465
466impl Request for ReadMemory {
467 const COMMAND: &'static str = "readMemory";
468 type Arguments = crate::ReadMemoryArguments;
469 type Response = crate::ReadMemoryResponse;
470}
471
472/// Writes bytes to memory at the provided location.
473/// Clients should only call this request if the corresponding capability `supportsWriteMemoryRequest` is true.
474pub enum WriteMemory {}
475
476impl Request for WriteMemory {
477 const COMMAND: &'static str = "writeMemory";
478 type Arguments = crate::WriteMemoryArguments;
479 type Response = crate::WriteMemoryResponse;
480}
481
482/// Disassembles code stored at the provided location.
483/// Clients should only call this request if the corresponding capability `supportsDisassembleRequest` is true.
484pub enum Disassemble {}
485
486impl Request for Disassemble {
487 const COMMAND: &'static str = "disassemble";
488 type Arguments = crate::DisassembleArguments;
489 type Response = crate::DisassembleResponse;
490}