Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/debug/common/debugProtocol.d.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
/** Declaration module describing the VS Code debug protocol.
7
Auto-generated from json schema. Do not edit manually.
8
*/
9
declare module DebugProtocol {
10
11
/** Base class of requests, responses, and events. */
12
interface ProtocolMessage {
13
/** Sequence number of the message (also known as message ID). The `seq` for the first message sent by a client or debug adapter is 1, and for each subsequent message is 1 greater than the previous message sent by that actor. `seq` can be used to order requests, responses, and events, and to associate requests with their corresponding responses. For protocol messages of type `request` the sequence number can be used to cancel the request. */
14
seq: number;
15
/** Message type.
16
Values: 'request', 'response', 'event', etc.
17
*/
18
type: 'request' | 'response' | 'event' | string;
19
}
20
21
/** A client or debug adapter initiated request. */
22
interface Request extends ProtocolMessage {
23
// type: 'request';
24
/** The command to execute. */
25
command: string;
26
/** Object containing arguments for the command. */
27
arguments?: any;
28
}
29
30
/** A debug adapter initiated event. */
31
interface Event extends ProtocolMessage {
32
// type: 'event';
33
/** Type of event. */
34
event: string;
35
/** Event-specific information. */
36
body?: any;
37
}
38
39
/** Response for a request. */
40
interface Response extends ProtocolMessage {
41
// type: 'response';
42
/** Sequence number of the corresponding request. */
43
request_seq: number;
44
/** Outcome of the request.
45
If true, the request was successful and the `body` attribute may contain the result of the request.
46
If the value is false, the attribute `message` contains the error in short form and the `body` may contain additional information (see `ErrorResponse.body.error`).
47
*/
48
success: boolean;
49
/** The command requested. */
50
command: string;
51
/** Contains the raw error in short form if `success` is false.
52
This raw error might be interpreted by the client and is not shown in the UI.
53
Some predefined values exist.
54
Values:
55
'cancelled': the request was cancelled.
56
'notStopped': the request may be retried once the adapter is in a 'stopped' state.
57
etc.
58
*/
59
message?: 'cancelled' | 'notStopped' | string;
60
/** Contains request result if success is true and error details if success is false. */
61
body?: any;
62
}
63
64
/** On error (whenever `success` is false), the body can provide more details. */
65
interface ErrorResponse extends Response {
66
body: {
67
/** A structured error message. */
68
error?: Message;
69
};
70
}
71
72
/** Cancel request; value of command field is 'cancel'.
73
The `cancel` request is used by the client in two situations:
74
- to indicate that it is no longer interested in the result produced by a specific request issued earlier
75
- to cancel a progress sequence.
76
Clients should only call this request if the corresponding capability `supportsCancelRequest` is true.
77
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.
78
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.
79
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`).
80
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.
81
The progress that got cancelled still needs to send a `progressEnd` event back.
82
A client should not assume that progress just got cancelled after sending the `cancel` request.
83
*/
84
interface CancelRequest extends Request {
85
// command: 'cancel';
86
arguments?: CancelArguments;
87
}
88
89
/** Arguments for `cancel` request. */
90
interface CancelArguments {
91
/** The ID (attribute `seq`) of the request to cancel. If missing no request is cancelled.
92
Both a `requestId` and a `progressId` can be specified in one request.
93
*/
94
requestId?: number;
95
/** The ID (attribute `progressId`) of the progress to cancel. If missing no progress is cancelled.
96
Both a `requestId` and a `progressId` can be specified in one request.
97
*/
98
progressId?: string;
99
}
100
101
/** Response to `cancel` request. This is just an acknowledgement, so no body field is required. */
102
interface CancelResponse extends Response {
103
}
104
105
/** Event message for 'initialized' event type.
106
This event indicates that the debug adapter is ready to accept configuration requests (e.g. `setBreakpoints`, `setExceptionBreakpoints`).
107
A debug adapter is expected to send this event when it is ready to accept configuration requests (but not before the `initialize` request has finished).
108
The sequence of events/requests is as follows:
109
- adapters sends `initialized` event (after the `initialize` request has returned)
110
- client sends zero or more `setBreakpoints` requests
111
- client sends one `setFunctionBreakpoints` request (if corresponding capability `supportsFunctionBreakpoints` is true)
112
- client sends a `setExceptionBreakpoints` request if one or more `exceptionBreakpointFilters` have been defined (or if `supportsConfigurationDoneRequest` is not true)
113
- client sends other future configuration requests
114
- client sends one `configurationDone` request to indicate the end of the configuration.
115
*/
116
interface InitializedEvent extends Event {
117
// event: 'initialized';
118
}
119
120
/** Event message for 'stopped' event type.
121
The event indicates that the execution of the debuggee has stopped due to some condition.
122
This can be caused by a breakpoint previously set, a stepping request has completed, by executing a debugger statement etc.
123
*/
124
interface StoppedEvent extends Event {
125
// event: 'stopped';
126
body: {
127
/** The reason for the event.
128
For backward compatibility this string is shown in the UI if the `description` attribute is missing (but it must not be translated).
129
Values: 'step', 'breakpoint', 'exception', 'pause', 'entry', 'goto', 'function breakpoint', 'data breakpoint', 'instruction breakpoint', etc.
130
*/
131
reason: 'step' | 'breakpoint' | 'exception' | 'pause' | 'entry' | 'goto' | 'function breakpoint' | 'data breakpoint' | 'instruction breakpoint' | string;
132
/** The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is and can be translated. */
133
description?: string;
134
/** The thread which was stopped. */
135
threadId?: number;
136
/** A value of true hints to the client that this event should not change the focus. */
137
preserveFocusHint?: boolean;
138
/** Additional information. E.g. if reason is `exception`, text contains the exception name. This string is shown in the UI. */
139
text?: string;
140
/** If `allThreadsStopped` is true, a debug adapter can announce that all threads have stopped.
141
- The client should use this information to enable that all threads can be expanded to access their stacktraces.
142
- If the attribute is missing or false, only the thread with the given `threadId` can be expanded.
143
*/
144
allThreadsStopped?: boolean;
145
/** Ids of the breakpoints that triggered the event. In most cases there is only a single breakpoint but here are some examples for multiple breakpoints:
146
- Different types of breakpoints map to the same location.
147
- Multiple source breakpoints get collapsed to the same instruction by the compiler/runtime.
148
- Multiple function breakpoints with different function names map to the same location.
149
*/
150
hitBreakpointIds?: number[];
151
};
152
}
153
154
/** Event message for 'continued' event type.
155
The event indicates that the execution of the debuggee has continued.
156
Please note: a debug adapter is not expected to send this event in response to a request that implies that execution continues, e.g. `launch` or `continue`.
157
It is only necessary to send a `continued` event if there was no previous request that implied this.
158
*/
159
interface ContinuedEvent extends Event {
160
// event: 'continued';
161
body: {
162
/** The thread which was continued. */
163
threadId: number;
164
/** If `allThreadsContinued` is true, a debug adapter can announce that all threads have continued. */
165
allThreadsContinued?: boolean;
166
};
167
}
168
169
/** Event message for 'exited' event type.
170
The event indicates that the debuggee has exited and returns its exit code.
171
*/
172
interface ExitedEvent extends Event {
173
// event: 'exited';
174
body: {
175
/** The exit code returned from the debuggee. */
176
exitCode: number;
177
};
178
}
179
180
/** Event message for 'terminated' event type.
181
The event indicates that debugging of the debuggee has terminated. This does **not** mean that the debuggee itself has exited.
182
*/
183
interface TerminatedEvent extends Event {
184
// event: 'terminated';
185
body?: {
186
/** A debug adapter may set `restart` to true (or to an arbitrary object) to request that the client restarts the session.
187
The value is not interpreted by the client and passed unmodified as an attribute `__restart` to the `launch` and `attach` requests.
188
*/
189
restart?: any;
190
};
191
}
192
193
/** Event message for 'thread' event type.
194
The event indicates that a thread has started or exited.
195
*/
196
interface ThreadEvent extends Event {
197
// event: 'thread';
198
body: {
199
/** The reason for the event.
200
Values: 'started', 'exited', etc.
201
*/
202
reason: 'started' | 'exited' | string;
203
/** The identifier of the thread. */
204
threadId: number;
205
};
206
}
207
208
/** Event message for 'output' event type.
209
The event indicates that the target has produced some output.
210
*/
211
interface OutputEvent extends Event {
212
// event: 'output';
213
body: {
214
/** The output category. If not specified or if the category is not understood by the client, `console` is assumed.
215
Values:
216
'console': Show the output in the client's default message UI, e.g. a 'debug console'. This category should only be used for informational output from the debugger (as opposed to the debuggee).
217
'important': A hint for the client to show the output in the client's UI for important and highly visible information, e.g. as a popup notification. This category should only be used for important messages from the debugger (as opposed to the debuggee). Since this category value is a hint, clients might ignore the hint and assume the `console` category.
218
'stdout': Show the output as normal program output from the debuggee.
219
'stderr': Show the output as error program output from the debuggee.
220
'telemetry': Send the output to telemetry instead of showing it to the user.
221
etc.
222
*/
223
category?: 'console' | 'important' | 'stdout' | 'stderr' | 'telemetry' | string;
224
/** The output to report.
225
226
ANSI escape sequences may be used to inflience text color and styling if `supportsANSIStyling` is present in both the adapter's `Capabilities` and the client's `InitializeRequestArguments`. A client may strip any unrecognized ANSI sequences.
227
228
If the `supportsANSIStyling` capabilities are not both true, then the client should display the output literally.
229
*/
230
output: string;
231
/** Support for keeping an output log organized by grouping related messages.
232
'start': Start a new group in expanded mode. Subsequent output events are members of the group and should be shown indented.
233
The `output` attribute becomes the name of the group and is not indented.
234
'startCollapsed': Start a new group in collapsed mode. Subsequent output events are members of the group and should be shown indented (as soon as the group is expanded).
235
The `output` attribute becomes the name of the group and is not indented.
236
'end': End the current group and decrease the indentation of subsequent output events.
237
A non-empty `output` attribute is shown as the unindented end of the group.
238
*/
239
group?: 'start' | 'startCollapsed' | 'end';
240
/** If an attribute `variablesReference` exists and its value is > 0, the output contains objects which can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. */
241
variablesReference?: number;
242
/** The source location where the output was produced. */
243
source?: Source;
244
/** The source location's line where the output was produced. */
245
line?: number;
246
/** The position in `line` where the output was produced. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
247
column?: number;
248
/** Additional data to report. For the `telemetry` category the data is sent to telemetry, for the other categories the data is shown in JSON format. */
249
data?: any;
250
/** A reference that allows the client to request the location where the new value is declared. For example, if the logged value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
251
252
This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
253
*/
254
locationReference?: number;
255
};
256
}
257
258
/** Event message for 'breakpoint' event type.
259
The event indicates that some information about a breakpoint has changed.
260
*/
261
interface BreakpointEvent extends Event {
262
// event: 'breakpoint';
263
body: {
264
/** The reason for the event.
265
Values: 'changed', 'new', 'removed', etc.
266
*/
267
reason: 'changed' | 'new' | 'removed' | string;
268
/** The `id` attribute is used to find the target breakpoint, the other attributes are used as the new values. */
269
breakpoint: Breakpoint;
270
};
271
}
272
273
/** Event message for 'module' event type.
274
The event indicates that some information about a module has changed.
275
*/
276
interface ModuleEvent extends Event {
277
// event: 'module';
278
body: {
279
/** The reason for the event. */
280
reason: 'new' | 'changed' | 'removed';
281
/** The new, changed, or removed module. In case of `removed` only the module id is used. */
282
module: Module;
283
};
284
}
285
286
/** Event message for 'loadedSource' event type.
287
The event indicates that some source has been added, changed, or removed from the set of all loaded sources.
288
*/
289
interface LoadedSourceEvent extends Event {
290
// event: 'loadedSource';
291
body: {
292
/** The reason for the event. */
293
reason: 'new' | 'changed' | 'removed';
294
/** The new, changed, or removed source. */
295
source: Source;
296
};
297
}
298
299
/** Event message for 'process' event type.
300
The event indicates that the debugger has begun debugging a new process. Either one that it has launched, or one that it has attached to.
301
*/
302
interface ProcessEvent extends Event {
303
// event: 'process';
304
body: {
305
/** The logical name of the process. This is usually the full path to process's executable file. Example: /home/example/myproj/program.js. */
306
name: string;
307
/** The process ID of the debugged process, as assigned by the operating system. This property should be omitted for logical processes that do not map to operating system processes on the machine. */
308
systemProcessId?: number;
309
/** If true, the process is running on the same computer as the debug adapter. */
310
isLocalProcess?: boolean;
311
/** Describes how the debug engine started debugging this process.
312
'launch': Process was launched under the debugger.
313
'attach': Debugger attached to an existing process.
314
'attachForSuspendedLaunch': A project launcher component has launched a new process in a suspended state and then asked the debugger to attach.
315
*/
316
startMethod?: 'launch' | 'attach' | 'attachForSuspendedLaunch';
317
/** The size of a pointer or address for this process, in bits. This value may be used by clients when formatting addresses for display. */
318
pointerSize?: number;
319
};
320
}
321
322
/** Event message for 'capabilities' event type.
323
The event indicates that one or more capabilities have changed.
324
Since the capabilities are dependent on the client and its UI, it might not be possible to change that at random times (or too late).
325
Consequently this event has a hint characteristic: a client can only be expected to make a 'best effort' in honoring individual capabilities but there are no guarantees.
326
Only changed capabilities need to be included, all other capabilities keep their values.
327
*/
328
interface CapabilitiesEvent extends Event {
329
// event: 'capabilities';
330
body: {
331
/** The set of updated capabilities. */
332
capabilities: Capabilities;
333
};
334
}
335
336
/** Event message for 'progressStart' event type.
337
The event signals that a long running operation is about to start and provides additional information for the client to set up a corresponding progress and cancellation UI.
338
The client is free to delay the showing of the UI in order to reduce flicker.
339
This event should only be sent if the corresponding capability `supportsProgressReporting` is true.
340
*/
341
interface ProgressStartEvent extends Event {
342
// event: 'progressStart';
343
body: {
344
/** An ID that can be used in subsequent `progressUpdate` and `progressEnd` events to make them refer to the same progress reporting.
345
IDs must be unique within a debug session.
346
*/
347
progressId: string;
348
/** Short title of the progress reporting. Shown in the UI to describe the long running operation. */
349
title: string;
350
/** The request ID that this progress report is related to. If specified a debug adapter is expected to emit progress events for the long running request until the request has been either completed or cancelled.
351
If the request ID is omitted, the progress report is assumed to be related to some general activity of the debug adapter.
352
*/
353
requestId?: number;
354
/** If true, the request that reports progress may be cancelled with a `cancel` request.
355
So this property basically controls whether the client should use UX that supports cancellation.
356
Clients that don't support cancellation are allowed to ignore the setting.
357
*/
358
cancellable?: boolean;
359
/** More detailed progress message. */
360
message?: string;
361
/** Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown. */
362
percentage?: number;
363
};
364
}
365
366
/** Event message for 'progressUpdate' event type.
367
The event signals that the progress reporting needs to be updated with a new message and/or percentage.
368
The client does not have to update the UI immediately, but the clients needs to keep track of the message and/or percentage values.
369
This event should only be sent if the corresponding capability `supportsProgressReporting` is true.
370
*/
371
interface ProgressUpdateEvent extends Event {
372
// event: 'progressUpdate';
373
body: {
374
/** The ID that was introduced in the initial `progressStart` event. */
375
progressId: string;
376
/** More detailed progress message. If omitted, the previous message (if any) is used. */
377
message?: string;
378
/** Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown. */
379
percentage?: number;
380
};
381
}
382
383
/** Event message for 'progressEnd' event type.
384
The event signals the end of the progress reporting with a final message.
385
This event should only be sent if the corresponding capability `supportsProgressReporting` is true.
386
*/
387
interface ProgressEndEvent extends Event {
388
// event: 'progressEnd';
389
body: {
390
/** The ID that was introduced in the initial `ProgressStartEvent`. */
391
progressId: string;
392
/** More detailed progress message. If omitted, the previous message (if any) is used. */
393
message?: string;
394
};
395
}
396
397
/** Event message for 'invalidated' event type.
398
This event signals that some state in the debug adapter has changed and requires that the client needs to re-render the data snapshot previously requested.
399
Debug adapters do not have to emit this event for runtime changes like stopped or thread events because in that case the client refetches the new state anyway. But the event can be used for example to refresh the UI after rendering formatting has changed in the debug adapter.
400
This event should only be sent if the corresponding capability `supportsInvalidatedEvent` is true.
401
*/
402
interface InvalidatedEvent extends Event {
403
// event: 'invalidated';
404
body: {
405
/** Set of logical areas that got invalidated. This property has a hint characteristic: a client can only be expected to make a 'best effort' in honoring the areas but there are no guarantees. If this property is missing, empty, or if values are not understood, the client should assume a single value `all`. */
406
areas?: InvalidatedAreas[];
407
/** If specified, the client only needs to refetch data related to this thread. */
408
threadId?: number;
409
/** If specified, the client only needs to refetch data related to this stack frame (and the `threadId` is ignored). */
410
stackFrameId?: number;
411
};
412
}
413
414
/** Event message for 'memory' event type.
415
This event indicates that some memory range has been updated. It should only be sent if the corresponding capability `supportsMemoryEvent` is true.
416
Clients typically react to the event by re-issuing a `readMemory` request if they show the memory identified by the `memoryReference` and if the updated memory range overlaps the displayed range. Clients should not make assumptions how individual memory references relate to each other, so they should not assume that they are part of a single continuous address range and might overlap.
417
Debug adapters can use this event to indicate that the contents of a memory range has changed due to some other request like `setVariable` or `setExpression`. Debug adapters are not expected to emit this event for each and every memory change of a running program, because that information is typically not available from debuggers and it would flood clients with too many events.
418
*/
419
interface MemoryEvent extends Event {
420
// event: 'memory';
421
body: {
422
/** Memory reference of a memory range that has been updated. */
423
memoryReference: string;
424
/** Starting offset in bytes where memory has been updated. Can be negative. */
425
offset: number;
426
/** Number of bytes updated. */
427
count: number;
428
};
429
}
430
431
/** RunInTerminal request; value of command field is 'runInTerminal'.
432
This request is sent from the debug adapter to the client to run a command in a terminal.
433
This is typically used to launch the debuggee in a terminal provided by the client.
434
This request should only be called if the corresponding client capability `supportsRunInTerminalRequest` is true.
435
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.
436
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.
437
*/
438
interface RunInTerminalRequest extends Request {
439
// command: 'runInTerminal';
440
arguments: RunInTerminalRequestArguments;
441
}
442
443
/** Arguments for `runInTerminal` request. */
444
interface RunInTerminalRequestArguments {
445
/** What kind of terminal to launch. Defaults to `integrated` if not specified. */
446
kind?: 'integrated' | 'external';
447
/** Title of the terminal. */
448
title?: string;
449
/** Working directory for the command. For non-empty, valid paths this typically results in execution of a change directory command. */
450
cwd: string;
451
/** List of arguments. The first argument is the command to run. */
452
args: string[];
453
/** Environment key-value pairs that are added to or removed from the default environment. */
454
env?: { [key: string]: string | null; };
455
/** This property should only be set if the corresponding capability `supportsArgsCanBeInterpretedByShell` is true. If the client uses an intermediary shell to launch the application, then the client must not attempt to escape characters with special meanings for the shell. The user is fully responsible for escaping as needed and that arguments using special characters may not be portable across shells. */
456
argsCanBeInterpretedByShell?: boolean;
457
}
458
459
/** Response to `runInTerminal` request. */
460
interface RunInTerminalResponse extends Response {
461
body: {
462
/** The process ID. The value should be less than or equal to 2147483647 (2^31-1). */
463
processId?: number;
464
/** The process ID of the terminal shell. The value should be less than or equal to 2147483647 (2^31-1). */
465
shellProcessId?: number;
466
};
467
}
468
469
/** StartDebugging request; value of command field is 'startDebugging'.
470
This request is sent from the debug adapter to the client to start a new debug session of the same type as the caller.
471
This request should only be sent if the corresponding client capability `supportsStartDebuggingRequest` is true.
472
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.
473
*/
474
interface StartDebuggingRequest extends Request {
475
// command: 'startDebugging';
476
arguments: StartDebuggingRequestArguments;
477
}
478
479
/** Arguments for `startDebugging` request. */
480
interface StartDebuggingRequestArguments {
481
/** Arguments passed to the new debug session. The arguments must only contain properties understood by the `launch` or `attach` requests of the debug adapter and they must not contain any client-specific properties (e.g. `type`) or client-specific features (e.g. substitutable 'variables'). */
482
configuration: { [key: string]: any; };
483
/** Indicates whether the new debug session should be started with a `launch` or `attach` request. */
484
request: 'launch' | 'attach';
485
}
486
487
/** Response to `startDebugging` request. This is just an acknowledgement, so no body field is required. */
488
interface StartDebuggingResponse extends Response {
489
}
490
491
/** Initialize request; value of command field is 'initialize'.
492
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.
493
Until the debug adapter has responded with an `initialize` response, the client must not send any additional requests or events to the debug adapter.
494
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.
495
The `initialize` request may only be sent once.
496
*/
497
interface InitializeRequest extends Request {
498
// command: 'initialize';
499
arguments: InitializeRequestArguments;
500
}
501
502
/** Arguments for `initialize` request. */
503
interface InitializeRequestArguments {
504
/** The ID of the client using this adapter. */
505
clientID?: string;
506
/** The human-readable name of the client using this adapter. */
507
clientName?: string;
508
/** The ID of the debug adapter. */
509
adapterID: string;
510
/** The ISO-639 locale of the client using this adapter, e.g. en-US or de-CH. */
511
locale?: string;
512
/** If true all line numbers are 1-based (default). */
513
linesStartAt1?: boolean;
514
/** If true all column numbers are 1-based (default). */
515
columnsStartAt1?: boolean;
516
/** Determines in what format paths are specified. The default is `path`, which is the native format.
517
Values: 'path', 'uri', etc.
518
*/
519
pathFormat?: 'path' | 'uri' | string;
520
/** Client supports the `type` attribute for variables. */
521
supportsVariableType?: boolean;
522
/** Client supports the paging of variables. */
523
supportsVariablePaging?: boolean;
524
/** Client supports the `runInTerminal` request. */
525
supportsRunInTerminalRequest?: boolean;
526
/** Client supports memory references. */
527
supportsMemoryReferences?: boolean;
528
/** Client supports progress reporting. */
529
supportsProgressReporting?: boolean;
530
/** Client supports the `invalidated` event. */
531
supportsInvalidatedEvent?: boolean;
532
/** Client supports the `memory` event. */
533
supportsMemoryEvent?: boolean;
534
/** Client supports the `argsCanBeInterpretedByShell` attribute on the `runInTerminal` request. */
535
supportsArgsCanBeInterpretedByShell?: boolean;
536
/** Client supports the `startDebugging` request. */
537
supportsStartDebuggingRequest?: boolean;
538
/** The client will interpret ANSI escape sequences in the display of `OutputEvent.output` and `Variable.value` fields when `Capabilities.supportsANSIStyling` is also enabled. */
539
supportsANSIStyling?: boolean;
540
}
541
542
/** Response to `initialize` request. */
543
interface InitializeResponse extends Response {
544
/** The capabilities of this debug adapter. */
545
body?: Capabilities;
546
}
547
548
/** ConfigurationDone request; value of command field is 'configurationDone'.
549
This request indicates that the client has finished initialization of the debug adapter.
550
So it is the last request in the sequence of configuration requests (which was started by the `initialized` event).
551
Clients should only call this request if the corresponding capability `supportsConfigurationDoneRequest` is true.
552
*/
553
interface ConfigurationDoneRequest extends Request {
554
// command: 'configurationDone';
555
arguments?: ConfigurationDoneArguments;
556
}
557
558
/** Arguments for `configurationDone` request. */
559
interface ConfigurationDoneArguments {
560
}
561
562
/** Response to `configurationDone` request. This is just an acknowledgement, so no body field is required. */
563
interface ConfigurationDoneResponse extends Response {
564
}
565
566
/** Launch request; value of command field is 'launch'.
567
This launch request is sent from the client to the debug adapter to start the debuggee with or without debugging (if `noDebug` is true).
568
Since launching is debugger/runtime specific, the arguments for this request are not part of this specification.
569
*/
570
interface LaunchRequest extends Request {
571
// command: 'launch';
572
arguments: LaunchRequestArguments;
573
}
574
575
/** Arguments for `launch` request. Additional attributes are implementation specific. */
576
interface LaunchRequestArguments {
577
/** If true, the launch request should launch the program without enabling debugging. */
578
noDebug?: boolean;
579
/** Arbitrary data from the previous, restarted session.
580
The data is sent as the `restart` attribute of the `terminated` event.
581
The client should leave the data intact.
582
*/
583
__restart?: any;
584
}
585
586
/** Response to `launch` request. This is just an acknowledgement, so no body field is required. */
587
interface LaunchResponse extends Response {
588
}
589
590
/** Attach request; value of command field is 'attach'.
591
The `attach` request is sent from the client to the debug adapter to attach to a debuggee that is already running.
592
Since attaching is debugger/runtime specific, the arguments for this request are not part of this specification.
593
*/
594
interface AttachRequest extends Request {
595
// command: 'attach';
596
arguments: AttachRequestArguments;
597
}
598
599
/** Arguments for `attach` request. Additional attributes are implementation specific. */
600
interface AttachRequestArguments {
601
/** Arbitrary data from the previous, restarted session.
602
The data is sent as the `restart` attribute of the `terminated` event.
603
The client should leave the data intact.
604
*/
605
__restart?: any;
606
}
607
608
/** Response to `attach` request. This is just an acknowledgement, so no body field is required. */
609
interface AttachResponse extends Response {
610
}
611
612
/** Restart request; value of command field is 'restart'.
613
Restarts a debug session. Clients should only call this request if the corresponding capability `supportsRestartRequest` is true.
614
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.
615
*/
616
interface RestartRequest extends Request {
617
// command: 'restart';
618
arguments?: RestartArguments;
619
}
620
621
/** Arguments for `restart` request. */
622
interface RestartArguments {
623
/** The latest version of the `launch` or `attach` configuration. */
624
arguments?: LaunchRequestArguments | AttachRequestArguments;
625
}
626
627
/** Response to `restart` request. This is just an acknowledgement, so no body field is required. */
628
interface RestartResponse extends Response {
629
}
630
631
/** Disconnect request; value of command field is 'disconnect'.
632
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).
633
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.
634
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).
635
*/
636
interface DisconnectRequest extends Request {
637
// command: 'disconnect';
638
arguments?: DisconnectArguments;
639
}
640
641
/** Arguments for `disconnect` request. */
642
interface DisconnectArguments {
643
/** A value of true indicates that this `disconnect` request is part of a restart sequence. */
644
restart?: boolean;
645
/** Indicates whether the debuggee should be terminated when the debugger is disconnected.
646
If unspecified, the debug adapter is free to do whatever it thinks is best.
647
The attribute is only honored by a debug adapter if the corresponding capability `supportTerminateDebuggee` is true.
648
*/
649
terminateDebuggee?: boolean;
650
/** Indicates whether the debuggee should stay suspended when the debugger is disconnected.
651
If unspecified, the debuggee should resume execution.
652
The attribute is only honored by a debug adapter if the corresponding capability `supportSuspendDebuggee` is true.
653
*/
654
suspendDebuggee?: boolean;
655
}
656
657
/** Response to `disconnect` request. This is just an acknowledgement, so no body field is required. */
658
interface DisconnectResponse extends Response {
659
}
660
661
/** Terminate request; value of command field is 'terminate'.
662
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.
663
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.
664
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.
665
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.
666
*/
667
interface TerminateRequest extends Request {
668
// command: 'terminate';
669
arguments?: TerminateArguments;
670
}
671
672
/** Arguments for `terminate` request. */
673
interface TerminateArguments {
674
/** A value of true indicates that this `terminate` request is part of a restart sequence. */
675
restart?: boolean;
676
}
677
678
/** Response to `terminate` request. This is just an acknowledgement, so no body field is required. */
679
interface TerminateResponse extends Response {
680
}
681
682
/** BreakpointLocations request; value of command field is 'breakpointLocations'.
683
The `breakpointLocations` request returns all possible locations for source breakpoints in a given range.
684
Clients should only call this request if the corresponding capability `supportsBreakpointLocationsRequest` is true.
685
*/
686
interface BreakpointLocationsRequest extends Request {
687
// command: 'breakpointLocations';
688
arguments?: BreakpointLocationsArguments;
689
}
690
691
/** Arguments for `breakpointLocations` request. */
692
interface BreakpointLocationsArguments {
693
/** The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified. */
694
source: Source;
695
/** Start line of range to search possible breakpoint locations in. If only the line is specified, the request returns all possible locations in that line. */
696
line: number;
697
/** Start position within `line` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed. */
698
column?: number;
699
/** End line of range to search possible breakpoint locations in. If no end line is given, then the end line is assumed to be the start line. */
700
endLine?: number;
701
/** End position within `endLine` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no end column is given, the last position in the end line is assumed. */
702
endColumn?: number;
703
}
704
705
/** Response to `breakpointLocations` request.
706
Contains possible locations for source breakpoints.
707
*/
708
interface BreakpointLocationsResponse extends Response {
709
body: {
710
/** Sorted set of possible breakpoint locations. */
711
breakpoints: BreakpointLocation[];
712
};
713
}
714
715
/** SetBreakpoints request; value of command field is 'setBreakpoints'.
716
Sets multiple breakpoints for a single source and clears all previous breakpoints in that source.
717
To clear all breakpoint for a source, specify an empty array.
718
When a breakpoint is hit, a `stopped` event (with reason `breakpoint`) is generated.
719
*/
720
interface SetBreakpointsRequest extends Request {
721
// command: 'setBreakpoints';
722
arguments: SetBreakpointsArguments;
723
}
724
725
/** Arguments for `setBreakpoints` request. */
726
interface SetBreakpointsArguments {
727
/** The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified. */
728
source: Source;
729
/** The code locations of the breakpoints. */
730
breakpoints?: SourceBreakpoint[];
731
/** Deprecated: The code locations of the breakpoints. */
732
lines?: number[];
733
/** A value of true indicates that the underlying source has been modified which results in new breakpoint locations. */
734
sourceModified?: boolean;
735
}
736
737
/** Response to `setBreakpoints` request.
738
Returned is information about each breakpoint created by this request.
739
This includes the actual code location and whether the breakpoint could be verified.
740
The breakpoints returned are in the same order as the elements of the `breakpoints`
741
(or the deprecated `lines`) array in the arguments.
742
*/
743
interface SetBreakpointsResponse extends Response {
744
body: {
745
/** Information about the breakpoints.
746
The array elements are in the same order as the elements of the `breakpoints` (or the deprecated `lines`) array in the arguments.
747
*/
748
breakpoints: Breakpoint[];
749
};
750
}
751
752
/** SetFunctionBreakpoints request; value of command field is 'setFunctionBreakpoints'.
753
Replaces all existing function breakpoints with new function breakpoints.
754
To clear all function breakpoints, specify an empty array.
755
When a function breakpoint is hit, a `stopped` event (with reason `function breakpoint`) is generated.
756
Clients should only call this request if the corresponding capability `supportsFunctionBreakpoints` is true.
757
*/
758
interface SetFunctionBreakpointsRequest extends Request {
759
// command: 'setFunctionBreakpoints';
760
arguments: SetFunctionBreakpointsArguments;
761
}
762
763
/** Arguments for `setFunctionBreakpoints` request. */
764
interface SetFunctionBreakpointsArguments {
765
/** The function names of the breakpoints. */
766
breakpoints: FunctionBreakpoint[];
767
}
768
769
/** Response to `setFunctionBreakpoints` request.
770
Returned is information about each breakpoint created by this request.
771
*/
772
interface SetFunctionBreakpointsResponse extends Response {
773
body: {
774
/** Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array. */
775
breakpoints: Breakpoint[];
776
};
777
}
778
779
/** SetExceptionBreakpoints request; value of command field is 'setExceptionBreakpoints'.
780
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.
781
Clients should only call this request if the corresponding capability `exceptionBreakpointFilters` returns one or more filters.
782
*/
783
interface SetExceptionBreakpointsRequest extends Request {
784
// command: 'setExceptionBreakpoints';
785
arguments: SetExceptionBreakpointsArguments;
786
}
787
788
/** Arguments for `setExceptionBreakpoints` request. */
789
interface SetExceptionBreakpointsArguments {
790
/** Set of exception filters specified by their ID. The set of all possible exception filters is defined by the `exceptionBreakpointFilters` capability. The `filter` and `filterOptions` sets are additive. */
791
filters: string[];
792
/** Set of exception filters and their options. The set of all possible exception filters is defined by the `exceptionBreakpointFilters` capability. This attribute is only honored by a debug adapter if the corresponding capability `supportsExceptionFilterOptions` is true. The `filter` and `filterOptions` sets are additive. */
793
filterOptions?: ExceptionFilterOptions[];
794
/** Configuration options for selected exceptions.
795
The attribute is only honored by a debug adapter if the corresponding capability `supportsExceptionOptions` is true.
796
*/
797
exceptionOptions?: ExceptionOptions[];
798
}
799
800
/** Response to `setExceptionBreakpoints` request.
801
The response contains an array of `Breakpoint` objects with information about each exception breakpoint or filter. The `Breakpoint` objects are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays given as arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information.
802
The `verified` property of a `Breakpoint` object signals whether the exception breakpoint or filter could be successfully created and whether the condition is valid. In case of an error the `message` property explains the problem. The `id` property can be used to introduce a unique ID for the exception breakpoint or filter so that it can be updated subsequently by sending breakpoint events.
803
For backward compatibility both the `breakpoints` array and the enclosing `body` are optional. If these elements are missing a client is not able to show problems for individual exception breakpoints or filters.
804
*/
805
interface SetExceptionBreakpointsResponse extends Response {
806
body?: {
807
/** Information about the exception breakpoints or filters.
808
The breakpoints returned are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays in the arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information.
809
*/
810
breakpoints?: Breakpoint[];
811
};
812
}
813
814
/** DataBreakpointInfo request; value of command field is 'dataBreakpointInfo'.
815
Obtains information on a possible data breakpoint that could be set on an expression or variable.
816
Clients should only call this request if the corresponding capability `supportsDataBreakpoints` is true.
817
*/
818
interface DataBreakpointInfoRequest extends Request {
819
// command: 'dataBreakpointInfo';
820
arguments: DataBreakpointInfoArguments;
821
}
822
823
/** Arguments for `dataBreakpointInfo` request. */
824
interface DataBreakpointInfoArguments {
825
/** Reference to the variable container if the data breakpoint is requested for a child of the container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. */
826
variablesReference?: number;
827
/** The name of the variable's child to obtain data breakpoint information for.
828
If `variablesReference` isn't specified, this can be an expression, or an address if `asAddress` is also true.
829
*/
830
name: string;
831
/** When `name` is an expression, evaluate it in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. When `variablesReference` is specified, this property has no effect. */
832
frameId?: number;
833
/** If specified, a debug adapter should return information for the range of memory extending `bytes` number of bytes from the address or variable specified by `name`. Breakpoints set using the resulting data ID should pause on data access anywhere within that range.
834
835
Clients may set this property only if the `supportsDataBreakpointBytes` capability is true.
836
*/
837
bytes?: number;
838
/** If `true`, the `name` is a memory address and the debugger should interpret it as a decimal value, or hex value if it is prefixed with `0x`.
839
840
Clients may set this property only if the `supportsDataBreakpointBytes`
841
capability is true.
842
*/
843
asAddress?: boolean;
844
/** The mode of the desired breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. */
845
mode?: string;
846
}
847
848
/** Response to `dataBreakpointInfo` request. */
849
interface DataBreakpointInfoResponse extends Response {
850
body: {
851
/** An identifier for the data on which a data breakpoint can be registered with the `setDataBreakpoints` request or null if no data breakpoint is available. If a `variablesReference` or `frameId` is passed, the `dataId` is valid in the current suspended state, otherwise it's valid indefinitely. See 'Lifetime of Object References' in the Overview section for details. Breakpoints set using the `dataId` in the `setDataBreakpoints` request may outlive the lifetime of the associated `dataId`. */
852
dataId: string | null;
853
/** UI string that describes on what data the breakpoint is set on or why a data breakpoint is not available. */
854
description: string;
855
/** Attribute lists the available access types for a potential data breakpoint. A UI client could surface this information. */
856
accessTypes?: DataBreakpointAccessType[];
857
/** Attribute indicates that a potential data breakpoint could be persisted across sessions. */
858
canPersist?: boolean;
859
};
860
}
861
862
/** SetDataBreakpoints request; value of command field is 'setDataBreakpoints'.
863
Replaces all existing data breakpoints with new data breakpoints.
864
To clear all data breakpoints, specify an empty array.
865
When a data breakpoint is hit, a `stopped` event (with reason `data breakpoint`) is generated.
866
Clients should only call this request if the corresponding capability `supportsDataBreakpoints` is true.
867
*/
868
interface SetDataBreakpointsRequest extends Request {
869
// command: 'setDataBreakpoints';
870
arguments: SetDataBreakpointsArguments;
871
}
872
873
/** Arguments for `setDataBreakpoints` request. */
874
interface SetDataBreakpointsArguments {
875
/** The contents of this array replaces all existing data breakpoints. An empty array clears all data breakpoints. */
876
breakpoints: DataBreakpoint[];
877
}
878
879
/** Response to `setDataBreakpoints` request.
880
Returned is information about each breakpoint created by this request.
881
*/
882
interface SetDataBreakpointsResponse extends Response {
883
body: {
884
/** Information about the data breakpoints. The array elements correspond to the elements of the input argument `breakpoints` array. */
885
breakpoints: Breakpoint[];
886
};
887
}
888
889
/** SetInstructionBreakpoints request; value of command field is 'setInstructionBreakpoints'.
890
Replaces all existing instruction breakpoints. Typically, instruction breakpoints would be set from a disassembly window.
891
To clear all instruction breakpoints, specify an empty array.
892
When an instruction breakpoint is hit, a `stopped` event (with reason `instruction breakpoint`) is generated.
893
Clients should only call this request if the corresponding capability `supportsInstructionBreakpoints` is true.
894
*/
895
interface SetInstructionBreakpointsRequest extends Request {
896
// command: 'setInstructionBreakpoints';
897
arguments: SetInstructionBreakpointsArguments;
898
}
899
900
/** Arguments for `setInstructionBreakpoints` request */
901
interface SetInstructionBreakpointsArguments {
902
/** The instruction references of the breakpoints */
903
breakpoints: InstructionBreakpoint[];
904
}
905
906
/** Response to `setInstructionBreakpoints` request */
907
interface SetInstructionBreakpointsResponse extends Response {
908
body: {
909
/** Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array. */
910
breakpoints: Breakpoint[];
911
};
912
}
913
914
/** Continue request; value of command field is 'continue'.
915
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.
916
*/
917
interface ContinueRequest extends Request {
918
// command: 'continue';
919
arguments: ContinueArguments;
920
}
921
922
/** Arguments for `continue` request. */
923
interface ContinueArguments {
924
/** Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the argument `singleThread` is true, only the thread with this ID is resumed. */
925
threadId: number;
926
/** If this flag is true, execution is resumed only for the thread with given `threadId`. */
927
singleThread?: boolean;
928
}
929
930
/** Response to `continue` request. */
931
interface ContinueResponse extends Response {
932
body: {
933
/** The value true (or a missing property) signals to the client that all threads have been resumed. The value false indicates that not all threads were resumed. */
934
allThreadsContinued?: boolean;
935
};
936
}
937
938
/** Next request; value of command field is 'next'.
939
The request executes one step (in the given granularity) for the specified thread and allows all other threads to run freely by resuming them.
940
If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.
941
The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.
942
*/
943
interface NextRequest extends Request {
944
// command: 'next';
945
arguments: NextArguments;
946
}
947
948
/** Arguments for `next` request. */
949
interface NextArguments {
950
/** Specifies the thread for which to resume execution for one step (of the given granularity). */
951
threadId: number;
952
/** If this flag is true, all other suspended threads are not resumed. */
953
singleThread?: boolean;
954
/** Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed. */
955
granularity?: SteppingGranularity;
956
}
957
958
/** Response to `next` request. This is just an acknowledgement, so no body field is required. */
959
interface NextResponse extends Response {
960
}
961
962
/** StepIn request; value of command field is 'stepIn'.
963
The request resumes the given thread to step into a function/method and allows all other threads to run freely by resuming them.
964
If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.
965
If the request cannot step into a target, `stepIn` behaves like the `next` request.
966
The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.
967
If there are multiple function/method calls (or other targets) on the source line,
968
the argument `targetId` can be used to control into which target the `stepIn` should occur.
969
The list of possible targets for a given source line can be retrieved via the `stepInTargets` request.
970
*/
971
interface StepInRequest extends Request {
972
// command: 'stepIn';
973
arguments: StepInArguments;
974
}
975
976
/** Arguments for `stepIn` request. */
977
interface StepInArguments {
978
/** Specifies the thread for which to resume execution for one step-into (of the given granularity). */
979
threadId: number;
980
/** If this flag is true, all other suspended threads are not resumed. */
981
singleThread?: boolean;
982
/** Id of the target to step into. */
983
targetId?: number;
984
/** Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed. */
985
granularity?: SteppingGranularity;
986
}
987
988
/** Response to `stepIn` request. This is just an acknowledgement, so no body field is required. */
989
interface StepInResponse extends Response {
990
}
991
992
/** StepOut request; value of command field is 'stepOut'.
993
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.
994
If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.
995
The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.
996
*/
997
interface StepOutRequest extends Request {
998
// command: 'stepOut';
999
arguments: StepOutArguments;
1000
}
1001
1002
/** Arguments for `stepOut` request. */
1003
interface StepOutArguments {
1004
/** Specifies the thread for which to resume execution for one step-out (of the given granularity). */
1005
threadId: number;
1006
/** If this flag is true, all other suspended threads are not resumed. */
1007
singleThread?: boolean;
1008
/** Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed. */
1009
granularity?: SteppingGranularity;
1010
}
1011
1012
/** Response to `stepOut` request. This is just an acknowledgement, so no body field is required. */
1013
interface StepOutResponse extends Response {
1014
}
1015
1016
/** StepBack request; value of command field is 'stepBack'.
1017
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.
1018
If the debug adapter supports single thread execution (see capability `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument to true prevents other suspended threads from resuming.
1019
The debug adapter first sends the response and then a `stopped` event (with reason `step`) after the step has completed.
1020
Clients should only call this request if the corresponding capability `supportsStepBack` is true.
1021
*/
1022
interface StepBackRequest extends Request {
1023
// command: 'stepBack';
1024
arguments: StepBackArguments;
1025
}
1026
1027
/** Arguments for `stepBack` request. */
1028
interface StepBackArguments {
1029
/** Specifies the thread for which to resume execution for one step backwards (of the given granularity). */
1030
threadId: number;
1031
/** If this flag is true, all other suspended threads are not resumed. */
1032
singleThread?: boolean;
1033
/** Stepping granularity to step. If no granularity is specified, a granularity of `statement` is assumed. */
1034
granularity?: SteppingGranularity;
1035
}
1036
1037
/** Response to `stepBack` request. This is just an acknowledgement, so no body field is required. */
1038
interface StepBackResponse extends Response {
1039
}
1040
1041
/** ReverseContinue request; value of command field is 'reverseContinue'.
1042
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.
1043
Clients should only call this request if the corresponding capability `supportsStepBack` is true.
1044
*/
1045
interface ReverseContinueRequest extends Request {
1046
// command: 'reverseContinue';
1047
arguments: ReverseContinueArguments;
1048
}
1049
1050
/** Arguments for `reverseContinue` request. */
1051
interface ReverseContinueArguments {
1052
/** Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the `singleThread` argument is true, only the thread with this ID is resumed. */
1053
threadId: number;
1054
/** If this flag is true, backward execution is resumed only for the thread with given `threadId`. */
1055
singleThread?: boolean;
1056
}
1057
1058
/** Response to `reverseContinue` request. This is just an acknowledgement, so no body field is required. */
1059
interface ReverseContinueResponse extends Response {
1060
}
1061
1062
/** RestartFrame request; value of command field is 'restartFrame'.
1063
The request restarts execution of the specified stack frame.
1064
The debug adapter first sends the response and then a `stopped` event (with reason `restart`) after the restart has completed.
1065
Clients should only call this request if the corresponding capability `supportsRestartFrame` is true.
1066
*/
1067
interface RestartFrameRequest extends Request {
1068
// command: 'restartFrame';
1069
arguments: RestartFrameArguments;
1070
}
1071
1072
/** Arguments for `restartFrame` request. */
1073
interface RestartFrameArguments {
1074
/** Restart the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. */
1075
frameId: number;
1076
}
1077
1078
/** Response to `restartFrame` request. This is just an acknowledgement, so no body field is required. */
1079
interface RestartFrameResponse extends Response {
1080
}
1081
1082
/** Goto request; value of command field is 'goto'.
1083
The request sets the location where the debuggee will continue to run.
1084
This makes it possible to skip the execution of code or to execute code again.
1085
The code between the current location and the goto target is not executed but skipped.
1086
The debug adapter first sends the response and then a `stopped` event with reason `goto`.
1087
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).
1088
*/
1089
interface GotoRequest extends Request {
1090
// command: 'goto';
1091
arguments: GotoArguments;
1092
}
1093
1094
/** Arguments for `goto` request. */
1095
interface GotoArguments {
1096
/** Set the goto target for this thread. */
1097
threadId: number;
1098
/** The location where the debuggee will continue to run. */
1099
targetId: number;
1100
}
1101
1102
/** Response to `goto` request. This is just an acknowledgement, so no body field is required. */
1103
interface GotoResponse extends Response {
1104
}
1105
1106
/** Pause request; value of command field is 'pause'.
1107
The request suspends the debuggee.
1108
The debug adapter first sends the response and then a `stopped` event (with reason `pause`) after the thread has been paused successfully.
1109
*/
1110
interface PauseRequest extends Request {
1111
// command: 'pause';
1112
arguments: PauseArguments;
1113
}
1114
1115
/** Arguments for `pause` request. */
1116
interface PauseArguments {
1117
/** Pause execution for this thread. */
1118
threadId: number;
1119
}
1120
1121
/** Response to `pause` request. This is just an acknowledgement, so no body field is required. */
1122
interface PauseResponse extends Response {
1123
}
1124
1125
/** StackTrace request; value of command field is 'stackTrace'.
1126
The request returns a stacktrace from the current execution state of a given thread.
1127
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.
1128
*/
1129
interface StackTraceRequest extends Request {
1130
// command: 'stackTrace';
1131
arguments: StackTraceArguments;
1132
}
1133
1134
/** Arguments for `stackTrace` request. */
1135
interface StackTraceArguments {
1136
/** Retrieve the stacktrace for this thread. */
1137
threadId: number;
1138
/** The index of the first frame to return; if omitted frames start at 0. */
1139
startFrame?: number;
1140
/** The maximum number of frames to return. If levels is not specified or 0, all frames are returned. */
1141
levels?: number;
1142
/** Specifies details on how to format the stack frames.
1143
The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true.
1144
*/
1145
format?: StackFrameFormat;
1146
}
1147
1148
/** Response to `stackTrace` request. */
1149
interface StackTraceResponse extends Response {
1150
body: {
1151
/** The frames of the stack frame. If the array has length zero, there are no stack frames available.
1152
This means that there is no location information available.
1153
*/
1154
stackFrames: StackFrame[];
1155
/** The total number of frames available in the stack. If omitted or if `totalFrames` is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). Returning monotonically increasing `totalFrames` values for subsequent requests can be used to enforce paging in the client. */
1156
totalFrames?: number;
1157
};
1158
}
1159
1160
/** Scopes request; value of command field is 'scopes'.
1161
The request returns the variable scopes for a given stack frame ID.
1162
*/
1163
interface ScopesRequest extends Request {
1164
// command: 'scopes';
1165
arguments: ScopesArguments;
1166
}
1167
1168
/** Arguments for `scopes` request. */
1169
interface ScopesArguments {
1170
/** Retrieve the scopes for the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. */
1171
frameId: number;
1172
}
1173
1174
/** Response to `scopes` request. */
1175
interface ScopesResponse extends Response {
1176
body: {
1177
/** The scopes of the stack frame. If the array has length zero, there are no scopes available. */
1178
scopes: Scope[];
1179
};
1180
}
1181
1182
/** Variables request; value of command field is 'variables'.
1183
Retrieves all child variables for the given variable reference.
1184
A filter can be used to limit the fetched children to either named or indexed children.
1185
*/
1186
interface VariablesRequest extends Request {
1187
// command: 'variables';
1188
arguments: VariablesArguments;
1189
}
1190
1191
/** Arguments for `variables` request. */
1192
interface VariablesArguments {
1193
/** The variable for which to retrieve its children. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. */
1194
variablesReference: number;
1195
/** Filter to limit the child variables to either named or indexed. If omitted, both types are fetched. */
1196
filter?: 'indexed' | 'named';
1197
/** The index of the first variable to return; if omitted children start at 0.
1198
The attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true.
1199
*/
1200
start?: number;
1201
/** The number of variables to return. If count is missing or 0, all variables are returned.
1202
The attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true.
1203
*/
1204
count?: number;
1205
/** Specifies details on how to format the Variable values.
1206
The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true.
1207
*/
1208
format?: ValueFormat;
1209
}
1210
1211
/** Response to `variables` request. */
1212
interface VariablesResponse extends Response {
1213
body: {
1214
/** All (or a range) of variables for the given variable reference. */
1215
variables: Variable[];
1216
};
1217
}
1218
1219
/** SetVariable request; value of command field is 'setVariable'.
1220
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.
1221
If a debug adapter implements both `setVariable` and `setExpression`, a client will only use `setExpression` if the variable has an `evaluateName` property.
1222
*/
1223
interface SetVariableRequest extends Request {
1224
// command: 'setVariable';
1225
arguments: SetVariableArguments;
1226
}
1227
1228
/** Arguments for `setVariable` request. */
1229
interface SetVariableArguments {
1230
/** The reference of the variable container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details. */
1231
variablesReference: number;
1232
/** The name of the variable in the container. */
1233
name: string;
1234
/** The value of the variable. */
1235
value: string;
1236
/** Specifies details on how to format the response value. */
1237
format?: ValueFormat;
1238
}
1239
1240
/** Response to `setVariable` request. */
1241
interface SetVariableResponse extends Response {
1242
body: {
1243
/** The new value of the variable. */
1244
value: string;
1245
/** The type of the new value. Typically shown in the UI when hovering over the value. */
1246
type?: string;
1247
/** If `variablesReference` is > 0, the new value is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details.
1248
1249
If this property is included in the response, any `variablesReference` previously associated with the updated variable, and those of its children, are no longer valid.
1250
*/
1251
variablesReference?: number;
1252
/** The number of named child variables.
1253
The client can use this information to present the variables in a paged UI and fetch them in chunks.
1254
The value should be less than or equal to 2147483647 (2^31-1).
1255
*/
1256
namedVariables?: number;
1257
/** The number of indexed child variables.
1258
The client can use this information to present the variables in a paged UI and fetch them in chunks.
1259
The value should be less than or equal to 2147483647 (2^31-1).
1260
*/
1261
indexedVariables?: number;
1262
/** A memory reference to a location appropriate for this result.
1263
For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
1264
This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
1265
*/
1266
memoryReference?: string;
1267
/** A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
1268
1269
This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
1270
*/
1271
valueLocationReference?: number;
1272
};
1273
}
1274
1275
/** Source request; value of command field is 'source'.
1276
The request retrieves the source code for a given source reference.
1277
*/
1278
interface SourceRequest extends Request {
1279
// command: 'source';
1280
arguments: SourceArguments;
1281
}
1282
1283
/** Arguments for `source` request. */
1284
interface SourceArguments {
1285
/** Specifies the source content to load. Either `source.path` or `source.sourceReference` must be specified. */
1286
source?: Source;
1287
/** The reference to the source. This is the same as `source.sourceReference`.
1288
This is provided for backward compatibility since old clients do not understand the `source` attribute.
1289
*/
1290
sourceReference: number;
1291
}
1292
1293
/** Response to `source` request. */
1294
interface SourceResponse extends Response {
1295
body: {
1296
/** Content of the source reference. */
1297
content: string;
1298
/** Content type (MIME type) of the source. */
1299
mimeType?: string;
1300
};
1301
}
1302
1303
/** Threads request; value of command field is 'threads'.
1304
The request retrieves a list of all threads.
1305
*/
1306
interface ThreadsRequest extends Request {
1307
// command: 'threads';
1308
}
1309
1310
/** Response to `threads` request. */
1311
interface ThreadsResponse extends Response {
1312
body: {
1313
/** All threads. */
1314
threads: Thread[];
1315
};
1316
}
1317
1318
/** TerminateThreads request; value of command field is 'terminateThreads'.
1319
The request terminates the threads with the given ids.
1320
Clients should only call this request if the corresponding capability `supportsTerminateThreadsRequest` is true.
1321
*/
1322
interface TerminateThreadsRequest extends Request {
1323
// command: 'terminateThreads';
1324
arguments: TerminateThreadsArguments;
1325
}
1326
1327
/** Arguments for `terminateThreads` request. */
1328
interface TerminateThreadsArguments {
1329
/** Ids of threads to be terminated. */
1330
threadIds?: number[];
1331
}
1332
1333
/** Response to `terminateThreads` request. This is just an acknowledgement, no body field is required. */
1334
interface TerminateThreadsResponse extends Response {
1335
}
1336
1337
/** Modules request; value of command field is 'modules'.
1338
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.
1339
Clients should only call this request if the corresponding capability `supportsModulesRequest` is true.
1340
*/
1341
interface ModulesRequest extends Request {
1342
// command: 'modules';
1343
arguments: ModulesArguments;
1344
}
1345
1346
/** Arguments for `modules` request. */
1347
interface ModulesArguments {
1348
/** The index of the first module to return; if omitted modules start at 0. */
1349
startModule?: number;
1350
/** The number of modules to return. If `moduleCount` is not specified or 0, all modules are returned. */
1351
moduleCount?: number;
1352
}
1353
1354
/** Response to `modules` request. */
1355
interface ModulesResponse extends Response {
1356
body: {
1357
/** All modules or range of modules. */
1358
modules: Module[];
1359
/** The total number of modules available. */
1360
totalModules?: number;
1361
};
1362
}
1363
1364
/** LoadedSources request; value of command field is 'loadedSources'.
1365
Retrieves the set of all sources currently loaded by the debugged process.
1366
Clients should only call this request if the corresponding capability `supportsLoadedSourcesRequest` is true.
1367
*/
1368
interface LoadedSourcesRequest extends Request {
1369
// command: 'loadedSources';
1370
arguments?: LoadedSourcesArguments;
1371
}
1372
1373
/** Arguments for `loadedSources` request. */
1374
interface LoadedSourcesArguments {
1375
}
1376
1377
/** Response to `loadedSources` request. */
1378
interface LoadedSourcesResponse extends Response {
1379
body: {
1380
/** Set of loaded sources. */
1381
sources: Source[];
1382
};
1383
}
1384
1385
/** Evaluate request; value of command field is 'evaluate'.
1386
Evaluates the given expression in the context of a stack frame.
1387
The expression has access to any variables and arguments that are in scope.
1388
*/
1389
interface EvaluateRequest extends Request {
1390
// command: 'evaluate';
1391
arguments: EvaluateArguments;
1392
}
1393
1394
/** Arguments for `evaluate` request. */
1395
interface EvaluateArguments {
1396
/** The expression to evaluate. */
1397
expression: string;
1398
/** Evaluate the expression in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. */
1399
frameId?: number;
1400
/** The contextual line where the expression should be evaluated. In the 'hover' context, this should be set to the start of the expression being hovered. */
1401
line?: number;
1402
/** The contextual column where the expression should be evaluated. This may be provided if `line` is also provided.
1403
1404
It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
1405
*/
1406
column?: number;
1407
/** The contextual source in which the `line` is found. This must be provided if `line` is provided. */
1408
source?: Source;
1409
/** The context in which the evaluate request is used.
1410
Values:
1411
'watch': evaluate is called from a watch view context.
1412
'repl': evaluate is called from a REPL context.
1413
'hover': evaluate is called to generate the debug hover contents.
1414
This value should only be used if the corresponding capability `supportsEvaluateForHovers` is true.
1415
'clipboard': evaluate is called to generate clipboard contents.
1416
This value should only be used if the corresponding capability `supportsClipboardContext` is true.
1417
'variables': evaluate is called from a variables view context.
1418
etc.
1419
*/
1420
context?: 'watch' | 'repl' | 'hover' | 'clipboard' | 'variables' | string;
1421
/** Specifies details on how to format the result.
1422
The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true.
1423
*/
1424
format?: ValueFormat;
1425
}
1426
1427
/** Response to `evaluate` request. */
1428
interface EvaluateResponse extends Response {
1429
body: {
1430
/** The result of the evaluate request. */
1431
result: string;
1432
/** The type of the evaluate result.
1433
This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true.
1434
*/
1435
type?: string;
1436
/** Properties of an evaluate result that can be used to determine how to render the result in the UI. */
1437
presentationHint?: VariablePresentationHint;
1438
/** If `variablesReference` is > 0, the evaluate result is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. */
1439
variablesReference: number;
1440
/** The number of named child variables.
1441
The client can use this information to present the variables in a paged UI and fetch them in chunks.
1442
The value should be less than or equal to 2147483647 (2^31-1).
1443
*/
1444
namedVariables?: number;
1445
/** The number of indexed child variables.
1446
The client can use this information to present the variables in a paged UI and fetch them in chunks.
1447
The value should be less than or equal to 2147483647 (2^31-1).
1448
*/
1449
indexedVariables?: number;
1450
/** A memory reference to a location appropriate for this result.
1451
For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
1452
This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
1453
*/
1454
memoryReference?: string;
1455
/** A reference that allows the client to request the location where the returned value is declared. For example, if a function pointer is returned, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
1456
1457
This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
1458
*/
1459
valueLocationReference?: number;
1460
};
1461
}
1462
1463
/** SetExpression request; value of command field is 'setExpression'.
1464
Evaluates the given `value` expression and assigns it to the `expression` which must be a modifiable l-value.
1465
The expressions have access to any variables and arguments that are in scope of the specified frame.
1466
Clients should only call this request if the corresponding capability `supportsSetExpression` is true.
1467
If a debug adapter implements both `setExpression` and `setVariable`, a client uses `setExpression` if the variable has an `evaluateName` property.
1468
*/
1469
interface SetExpressionRequest extends Request {
1470
// command: 'setExpression';
1471
arguments: SetExpressionArguments;
1472
}
1473
1474
/** Arguments for `setExpression` request. */
1475
interface SetExpressionArguments {
1476
/** The l-value expression to assign to. */
1477
expression: string;
1478
/** The value expression to assign to the l-value expression. */
1479
value: string;
1480
/** Evaluate the expressions in the scope of this stack frame. If not specified, the expressions are evaluated in the global scope. */
1481
frameId?: number;
1482
/** Specifies how the resulting value should be formatted. */
1483
format?: ValueFormat;
1484
}
1485
1486
/** Response to `setExpression` request. */
1487
interface SetExpressionResponse extends Response {
1488
body: {
1489
/** The new value of the expression. */
1490
value: string;
1491
/** The type of the value.
1492
This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true.
1493
*/
1494
type?: string;
1495
/** Properties of a value that can be used to determine how to render the result in the UI. */
1496
presentationHint?: VariablePresentationHint;
1497
/** If `variablesReference` is > 0, the evaluate result is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. */
1498
variablesReference?: number;
1499
/** The number of named child variables.
1500
The client can use this information to present the variables in a paged UI and fetch them in chunks.
1501
The value should be less than or equal to 2147483647 (2^31-1).
1502
*/
1503
namedVariables?: number;
1504
/** The number of indexed child variables.
1505
The client can use this information to present the variables in a paged UI and fetch them in chunks.
1506
The value should be less than or equal to 2147483647 (2^31-1).
1507
*/
1508
indexedVariables?: number;
1509
/** A memory reference to a location appropriate for this result.
1510
For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
1511
This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
1512
*/
1513
memoryReference?: string;
1514
/** A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
1515
1516
This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
1517
*/
1518
valueLocationReference?: number;
1519
};
1520
}
1521
1522
/** StepInTargets request; value of command field is 'stepInTargets'.
1523
This request retrieves the possible step-in targets for the specified stack frame.
1524
These targets can be used in the `stepIn` request.
1525
Clients should only call this request if the corresponding capability `supportsStepInTargetsRequest` is true.
1526
*/
1527
interface StepInTargetsRequest extends Request {
1528
// command: 'stepInTargets';
1529
arguments: StepInTargetsArguments;
1530
}
1531
1532
/** Arguments for `stepInTargets` request. */
1533
interface StepInTargetsArguments {
1534
/** The stack frame for which to retrieve the possible step-in targets. */
1535
frameId: number;
1536
}
1537
1538
/** Response to `stepInTargets` request. */
1539
interface StepInTargetsResponse extends Response {
1540
body: {
1541
/** The possible step-in targets of the specified source location. */
1542
targets: StepInTarget[];
1543
};
1544
}
1545
1546
/** GotoTargets request; value of command field is 'gotoTargets'.
1547
This request retrieves the possible goto targets for the specified source location.
1548
These targets can be used in the `goto` request.
1549
Clients should only call this request if the corresponding capability `supportsGotoTargetsRequest` is true.
1550
*/
1551
interface GotoTargetsRequest extends Request {
1552
// command: 'gotoTargets';
1553
arguments: GotoTargetsArguments;
1554
}
1555
1556
/** Arguments for `gotoTargets` request. */
1557
interface GotoTargetsArguments {
1558
/** The source location for which the goto targets are determined. */
1559
source: Source;
1560
/** The line location for which the goto targets are determined. */
1561
line: number;
1562
/** The position within `line` for which the goto targets are determined. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
1563
column?: number;
1564
}
1565
1566
/** Response to `gotoTargets` request. */
1567
interface GotoTargetsResponse extends Response {
1568
body: {
1569
/** The possible goto targets of the specified location. */
1570
targets: GotoTarget[];
1571
};
1572
}
1573
1574
/** Completions request; value of command field is 'completions'.
1575
Returns a list of possible completions for a given caret position and text.
1576
Clients should only call this request if the corresponding capability `supportsCompletionsRequest` is true.
1577
*/
1578
interface CompletionsRequest extends Request {
1579
// command: 'completions';
1580
arguments: CompletionsArguments;
1581
}
1582
1583
/** Arguments for `completions` request. */
1584
interface CompletionsArguments {
1585
/** Returns completions in the scope of this stack frame. If not specified, the completions are returned for the global scope. */
1586
frameId?: number;
1587
/** One or more source lines. Typically this is the text users have typed into the debug console before they asked for completion. */
1588
text: string;
1589
/** The position within `text` for which to determine the completion proposals. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
1590
column: number;
1591
/** A line for which to determine the completion proposals. If missing the first line of the text is assumed. */
1592
line?: number;
1593
}
1594
1595
/** Response to `completions` request. */
1596
interface CompletionsResponse extends Response {
1597
body: {
1598
/** The possible completions for . */
1599
targets: CompletionItem[];
1600
};
1601
}
1602
1603
/** ExceptionInfo request; value of command field is 'exceptionInfo'.
1604
Retrieves the details of the exception that caused this event to be raised.
1605
Clients should only call this request if the corresponding capability `supportsExceptionInfoRequest` is true.
1606
*/
1607
interface ExceptionInfoRequest extends Request {
1608
// command: 'exceptionInfo';
1609
arguments: ExceptionInfoArguments;
1610
}
1611
1612
/** Arguments for `exceptionInfo` request. */
1613
interface ExceptionInfoArguments {
1614
/** Thread for which exception information should be retrieved. */
1615
threadId: number;
1616
}
1617
1618
/** Response to `exceptionInfo` request. */
1619
interface ExceptionInfoResponse extends Response {
1620
body: {
1621
/** ID of the exception that was thrown. */
1622
exceptionId: string;
1623
/** Descriptive text for the exception. */
1624
description?: string;
1625
/** Mode that caused the exception notification to be raised. */
1626
breakMode: ExceptionBreakMode;
1627
/** Detailed information about the exception. */
1628
details?: ExceptionDetails;
1629
};
1630
}
1631
1632
/** ReadMemory request; value of command field is 'readMemory'.
1633
Reads bytes from memory at the provided location.
1634
Clients should only call this request if the corresponding capability `supportsReadMemoryRequest` is true.
1635
*/
1636
interface ReadMemoryRequest extends Request {
1637
// command: 'readMemory';
1638
arguments: ReadMemoryArguments;
1639
}
1640
1641
/** Arguments for `readMemory` request. */
1642
interface ReadMemoryArguments {
1643
/** Memory reference to the base location from which data should be read. */
1644
memoryReference: string;
1645
/** Offset (in bytes) to be applied to the reference location before reading data. Can be negative. */
1646
offset?: number;
1647
/** Number of bytes to read at the specified location and offset. */
1648
count: number;
1649
}
1650
1651
/** Response to `readMemory` request. */
1652
interface ReadMemoryResponse extends Response {
1653
body?: {
1654
/** The address of the first byte of data returned.
1655
Treated as a hex value if prefixed with `0x`, or as a decimal value otherwise.
1656
*/
1657
address: string;
1658
/** The number of unreadable bytes encountered after the last successfully read byte.
1659
This can be used to determine the number of bytes that should be skipped before a subsequent `readMemory` request succeeds.
1660
*/
1661
unreadableBytes?: number;
1662
/** The bytes read from memory, encoded using base64. If the decoded length of `data` is less than the requested `count` in the original `readMemory` request, and `unreadableBytes` is zero or omitted, then the client should assume it's reached the end of readable memory. */
1663
data?: string;
1664
};
1665
}
1666
1667
/** WriteMemory request; value of command field is 'writeMemory'.
1668
Writes bytes to memory at the provided location.
1669
Clients should only call this request if the corresponding capability `supportsWriteMemoryRequest` is true.
1670
*/
1671
interface WriteMemoryRequest extends Request {
1672
// command: 'writeMemory';
1673
arguments: WriteMemoryArguments;
1674
}
1675
1676
/** Arguments for `writeMemory` request. */
1677
interface WriteMemoryArguments {
1678
/** Memory reference to the base location to which data should be written. */
1679
memoryReference: string;
1680
/** Offset (in bytes) to be applied to the reference location before writing data. Can be negative. */
1681
offset?: number;
1682
/** Property to control partial writes. If true, the debug adapter should attempt to write memory even if the entire memory region is not writable. In such a case the debug adapter should stop after hitting the first byte of memory that cannot be written and return the number of bytes written in the response via the `offset` and `bytesWritten` properties.
1683
If false or missing, a debug adapter should attempt to verify the region is writable before writing, and fail the response if it is not.
1684
*/
1685
allowPartial?: boolean;
1686
/** Bytes to write, encoded using base64. */
1687
data: string;
1688
}
1689
1690
/** Response to `writeMemory` request. */
1691
interface WriteMemoryResponse extends Response {
1692
body?: {
1693
/** Property that should be returned when `allowPartial` is true to indicate the offset of the first byte of data successfully written. Can be negative. */
1694
offset?: number;
1695
/** Property that should be returned when `allowPartial` is true to indicate the number of bytes starting from address that were successfully written. */
1696
bytesWritten?: number;
1697
};
1698
}
1699
1700
/** Disassemble request; value of command field is 'disassemble'.
1701
Disassembles code stored at the provided location.
1702
Clients should only call this request if the corresponding capability `supportsDisassembleRequest` is true.
1703
*/
1704
interface DisassembleRequest extends Request {
1705
// command: 'disassemble';
1706
arguments: DisassembleArguments;
1707
}
1708
1709
/** Arguments for `disassemble` request. */
1710
interface DisassembleArguments {
1711
/** Memory reference to the base location containing the instructions to disassemble. */
1712
memoryReference: string;
1713
/** Offset (in bytes) to be applied to the reference location before disassembling. Can be negative. */
1714
offset?: number;
1715
/** Offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative. */
1716
instructionOffset?: number;
1717
/** Number of instructions to disassemble starting at the specified location and offset.
1718
An adapter must return exactly this number of instructions - any unavailable instructions should be replaced with an implementation-defined 'invalid instruction' value.
1719
*/
1720
instructionCount: number;
1721
/** If true, the adapter should attempt to resolve memory addresses and other values to symbolic names. */
1722
resolveSymbols?: boolean;
1723
}
1724
1725
/** Response to `disassemble` request. */
1726
interface DisassembleResponse extends Response {
1727
body?: {
1728
/** The list of disassembled instructions. */
1729
instructions: DisassembledInstruction[];
1730
};
1731
}
1732
1733
/** Locations request; value of command field is 'locations'.
1734
Looks up information about a location reference previously returned by the debug adapter.
1735
*/
1736
interface LocationsRequest extends Request {
1737
// command: 'locations';
1738
arguments: LocationsArguments;
1739
}
1740
1741
/** Arguments for `locations` request. */
1742
interface LocationsArguments {
1743
/** Location reference to resolve. */
1744
locationReference: number;
1745
}
1746
1747
/** Response to `locations` request. */
1748
interface LocationsResponse extends Response {
1749
body?: {
1750
/** The source containing the location; either `source.path` or `source.sourceReference` must be specified. */
1751
source: Source;
1752
/** The line number of the location. The client capability `linesStartAt1` determines whether it is 0- or 1-based. */
1753
line: number;
1754
/** Position of the location within the `line`. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed. */
1755
column?: number;
1756
/** End line of the location, present if the location refers to a range. The client capability `linesStartAt1` determines whether it is 0- or 1-based. */
1757
endLine?: number;
1758
/** End position of the location within `endLine`, present if the location refers to a range. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
1759
endColumn?: number;
1760
};
1761
}
1762
1763
/** Information about the capabilities of a debug adapter. */
1764
interface Capabilities {
1765
/** The debug adapter supports the `configurationDone` request. */
1766
supportsConfigurationDoneRequest?: boolean;
1767
/** The debug adapter supports function breakpoints. */
1768
supportsFunctionBreakpoints?: boolean;
1769
/** The debug adapter supports conditional breakpoints. */
1770
supportsConditionalBreakpoints?: boolean;
1771
/** The debug adapter supports breakpoints that break execution after a specified number of hits. */
1772
supportsHitConditionalBreakpoints?: boolean;
1773
/** The debug adapter supports a (side effect free) `evaluate` request for data hovers. */
1774
supportsEvaluateForHovers?: boolean;
1775
/** Available exception filter options for the `setExceptionBreakpoints` request. */
1776
exceptionBreakpointFilters?: ExceptionBreakpointsFilter[];
1777
/** The debug adapter supports stepping back via the `stepBack` and `reverseContinue` requests. */
1778
supportsStepBack?: boolean;
1779
/** The debug adapter supports setting a variable to a value. */
1780
supportsSetVariable?: boolean;
1781
/** The debug adapter supports restarting a frame. */
1782
supportsRestartFrame?: boolean;
1783
/** The debug adapter supports the `gotoTargets` request. */
1784
supportsGotoTargetsRequest?: boolean;
1785
/** The debug adapter supports the `stepInTargets` request. */
1786
supportsStepInTargetsRequest?: boolean;
1787
/** The debug adapter supports the `completions` request. */
1788
supportsCompletionsRequest?: boolean;
1789
/** The set of characters that should trigger completion in a REPL. If not specified, the UI should assume the `.` character. */
1790
completionTriggerCharacters?: string[];
1791
/** The debug adapter supports the `modules` request. */
1792
supportsModulesRequest?: boolean;
1793
/** The set of additional module information exposed by the debug adapter. */
1794
additionalModuleColumns?: ColumnDescriptor[];
1795
/** Checksum algorithms supported by the debug adapter. */
1796
supportedChecksumAlgorithms?: ChecksumAlgorithm[];
1797
/** The debug adapter supports the `restart` request. In this case a client should not implement `restart` by terminating and relaunching the adapter but by calling the `restart` request. */
1798
supportsRestartRequest?: boolean;
1799
/** The debug adapter supports `exceptionOptions` on the `setExceptionBreakpoints` request. */
1800
supportsExceptionOptions?: boolean;
1801
/** The debug adapter supports a `format` attribute on the `stackTrace`, `variables`, and `evaluate` requests. */
1802
supportsValueFormattingOptions?: boolean;
1803
/** The debug adapter supports the `exceptionInfo` request. */
1804
supportsExceptionInfoRequest?: boolean;
1805
/** The debug adapter supports the `terminateDebuggee` attribute on the `disconnect` request. */
1806
supportTerminateDebuggee?: boolean;
1807
/** The debug adapter supports the `suspendDebuggee` attribute on the `disconnect` request. */
1808
supportSuspendDebuggee?: boolean;
1809
/** The debug adapter supports the delayed loading of parts of the stack, which requires that both the `startFrame` and `levels` arguments and the `totalFrames` result of the `stackTrace` request are supported. */
1810
supportsDelayedStackTraceLoading?: boolean;
1811
/** The debug adapter supports the `loadedSources` request. */
1812
supportsLoadedSourcesRequest?: boolean;
1813
/** The debug adapter supports log points by interpreting the `logMessage` attribute of the `SourceBreakpoint`. */
1814
supportsLogPoints?: boolean;
1815
/** The debug adapter supports the `terminateThreads` request. */
1816
supportsTerminateThreadsRequest?: boolean;
1817
/** The debug adapter supports the `setExpression` request. */
1818
supportsSetExpression?: boolean;
1819
/** The debug adapter supports the `terminate` request. */
1820
supportsTerminateRequest?: boolean;
1821
/** The debug adapter supports data breakpoints. */
1822
supportsDataBreakpoints?: boolean;
1823
/** The debug adapter supports the `readMemory` request. */
1824
supportsReadMemoryRequest?: boolean;
1825
/** The debug adapter supports the `writeMemory` request. */
1826
supportsWriteMemoryRequest?: boolean;
1827
/** The debug adapter supports the `disassemble` request. */
1828
supportsDisassembleRequest?: boolean;
1829
/** The debug adapter supports the `cancel` request. */
1830
supportsCancelRequest?: boolean;
1831
/** The debug adapter supports the `breakpointLocations` request. */
1832
supportsBreakpointLocationsRequest?: boolean;
1833
/** The debug adapter supports the `clipboard` context value in the `evaluate` request. */
1834
supportsClipboardContext?: boolean;
1835
/** The debug adapter supports stepping granularities (argument `granularity`) for the stepping requests. */
1836
supportsSteppingGranularity?: boolean;
1837
/** The debug adapter supports adding breakpoints based on instruction references. */
1838
supportsInstructionBreakpoints?: boolean;
1839
/** The debug adapter supports `filterOptions` as an argument on the `setExceptionBreakpoints` request. */
1840
supportsExceptionFilterOptions?: boolean;
1841
/** The debug adapter supports the `singleThread` property on the execution requests (`continue`, `next`, `stepIn`, `stepOut`, `reverseContinue`, `stepBack`). */
1842
supportsSingleThreadExecutionRequests?: boolean;
1843
/** The debug adapter supports the `asAddress` and `bytes` fields in the `dataBreakpointInfo` request. */
1844
supportsDataBreakpointBytes?: boolean;
1845
/** Modes of breakpoints supported by the debug adapter, such as 'hardware' or 'software'. If present, the client may allow the user to select a mode and include it in its `setBreakpoints` request.
1846
1847
Clients may present the first applicable mode in this array as the 'default' mode in gestures that set breakpoints.
1848
*/
1849
breakpointModes?: BreakpointMode[];
1850
/** The debug adapter supports ANSI escape sequences in styling of `OutputEvent.output` and `Variable.value` fields. */
1851
supportsANSIStyling?: boolean;
1852
}
1853
1854
/** An `ExceptionBreakpointsFilter` is shown in the UI as an filter option for configuring how exceptions are dealt with. */
1855
interface ExceptionBreakpointsFilter {
1856
/** The internal ID of the filter option. This value is passed to the `setExceptionBreakpoints` request. */
1857
filter: string;
1858
/** The name of the filter option. This is shown in the UI. */
1859
label: string;
1860
/** A help text providing additional information about the exception filter. This string is typically shown as a hover and can be translated. */
1861
description?: string;
1862
/** Initial value of the filter option. If not specified a value false is assumed. */
1863
default?: boolean;
1864
/** Controls whether a condition can be specified for this filter option. If false or missing, a condition can not be set. */
1865
supportsCondition?: boolean;
1866
/** A help text providing information about the condition. This string is shown as the placeholder text for a text box and can be translated. */
1867
conditionDescription?: string;
1868
}
1869
1870
/** A structured message object. Used to return errors from requests. */
1871
interface Message {
1872
/** Unique (within a debug adapter implementation) identifier for the message. The purpose of these error IDs is to help extension authors that have the requirement that every user visible error message needs a corresponding error number, so that users or customer support can find information about the specific error more easily. */
1873
id: number;
1874
/** A format string for the message. Embedded variables have the form `{name}`.
1875
If variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes.
1876
*/
1877
format: string;
1878
/** An object used as a dictionary for looking up the variables in the format string. */
1879
variables?: { [key: string]: string; };
1880
/** If true send to telemetry. */
1881
sendTelemetry?: boolean;
1882
/** If true show user. */
1883
showUser?: boolean;
1884
/** A url where additional information about this message can be found. */
1885
url?: string;
1886
/** A label that is presented to the user as the UI for opening the url. */
1887
urlLabel?: string;
1888
}
1889
1890
/** A Module object represents a row in the modules view.
1891
The `id` attribute identifies a module in the modules view and is used in a `module` event for identifying a module for adding, updating or deleting.
1892
The `name` attribute is used to minimally render the module in the UI.
1893
1894
Additional attributes can be added to the module. They show up in the module view if they have a corresponding `ColumnDescriptor`.
1895
1896
To avoid an unnecessary proliferation of additional attributes with similar semantics but different names, we recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found.
1897
*/
1898
interface Module {
1899
/** Unique identifier for the module. */
1900
id: number | string;
1901
/** A name of the module. */
1902
name: string;
1903
/** Logical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module. */
1904
path?: string;
1905
/** True if the module is optimized. */
1906
isOptimized?: boolean;
1907
/** True if the module is considered 'user code' by a debugger that supports 'Just My Code'. */
1908
isUserCode?: boolean;
1909
/** Version of Module. */
1910
version?: string;
1911
/** User-understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc.) */
1912
symbolStatus?: string;
1913
/** Logical full path to the symbol file. The exact definition is implementation defined. */
1914
symbolFilePath?: string;
1915
/** Module created or modified, encoded as a RFC 3339 timestamp. */
1916
dateTimeStamp?: string;
1917
/** Address range covered by this module. */
1918
addressRange?: string;
1919
}
1920
1921
/** A `ColumnDescriptor` specifies what module attribute to show in a column of the modules view, how to format it,
1922
and what the column's label should be.
1923
It is only used if the underlying UI actually supports this level of customization.
1924
*/
1925
interface ColumnDescriptor {
1926
/** Name of the attribute rendered in this column. */
1927
attributeName: string;
1928
/** Header UI label of column. */
1929
label: string;
1930
/** Format to use for the rendered values in this column. TBD how the format strings looks like. */
1931
format?: string;
1932
/** Datatype of values in this column. Defaults to `string` if not specified. */
1933
type?: 'string' | 'number' | 'boolean' | 'unixTimestampUTC';
1934
/** Width of this column in characters (hint only). */
1935
width?: number;
1936
}
1937
1938
/** A Thread */
1939
interface Thread {
1940
/** Unique identifier for the thread. */
1941
id: number;
1942
/** The name of the thread. */
1943
name: string;
1944
}
1945
1946
/** A `Source` is a descriptor for source code.
1947
It is returned from the debug adapter as part of a `StackFrame` and it is used by clients when specifying breakpoints.
1948
*/
1949
interface Source {
1950
/** The short name of the source. Every source returned from the debug adapter has a name.
1951
When sending a source to the debug adapter this name is optional.
1952
*/
1953
name?: string;
1954
/** The path of the source to be shown in the UI.
1955
It is only used to locate and load the content of the source if no `sourceReference` is specified (or its value is 0).
1956
*/
1957
path?: string;
1958
/** If the value > 0 the contents of the source must be retrieved through the `source` request (even if a path is specified).
1959
Since a `sourceReference` is only valid for a session, it can not be used to persist a source.
1960
The value should be less than or equal to 2147483647 (2^31-1).
1961
*/
1962
sourceReference?: number;
1963
/** A hint for how to present the source in the UI.
1964
A value of `deemphasize` can be used to indicate that the source is not available or that it is skipped on stepping.
1965
*/
1966
presentationHint?: 'normal' | 'emphasize' | 'deemphasize';
1967
/** The origin of this source. For example, 'internal module', 'inlined content from source map', etc. */
1968
origin?: string;
1969
/** A list of sources that are related to this source. These may be the source that generated this source. */
1970
sources?: Source[];
1971
/** Additional data that a debug adapter might want to loop through the client.
1972
The client should leave the data intact and persist it across sessions. The client should not interpret the data.
1973
*/
1974
adapterData?: any;
1975
/** The checksums associated with this file. */
1976
checksums?: Checksum[];
1977
}
1978
1979
/** A Stackframe contains the source location. */
1980
interface StackFrame {
1981
/** An identifier for the stack frame. It must be unique across all threads.
1982
This id can be used to retrieve the scopes of the frame with the `scopes` request or to restart the execution of a stack frame.
1983
*/
1984
id: number;
1985
/** The name of the stack frame, typically a method name. */
1986
name: string;
1987
/** The source of the frame. */
1988
source?: Source;
1989
/** The line within the source of the frame. If the source attribute is missing or doesn't exist, `line` is 0 and should be ignored by the client. */
1990
line: number;
1991
/** Start position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If attribute `source` is missing or doesn't exist, `column` is 0 and should be ignored by the client. */
1992
column: number;
1993
/** The end line of the range covered by the stack frame. */
1994
endLine?: number;
1995
/** End position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
1996
endColumn?: number;
1997
/** Indicates whether this frame can be restarted with the `restartFrame` request. Clients should only use this if the debug adapter supports the `restart` request and the corresponding capability `supportsRestartFrame` is true. If a debug adapter has this capability, then `canRestart` defaults to `true` if the property is absent. */
1998
canRestart?: boolean;
1999
/** A memory reference for the current instruction pointer in this frame. */
2000
instructionPointerReference?: string;
2001
/** The module associated with this frame, if any. */
2002
moduleId?: number | string;
2003
/** A hint for how to present this frame in the UI.
2004
A value of `label` can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of `subtle` can be used to change the appearance of a frame in a 'subtle' way.
2005
*/
2006
presentationHint?: 'normal' | 'label' | 'subtle';
2007
}
2008
2009
/** A `Scope` is a named container for variables. Optionally a scope can map to a source or a range within a source. */
2010
interface Scope {
2011
/** Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This string is shown in the UI as is and can be translated. */
2012
name: string;
2013
/** A hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI.
2014
Values:
2015
'arguments': Scope contains method arguments.
2016
'locals': Scope contains local variables.
2017
'registers': Scope contains registers. Only a single `registers` scope should be returned from a `scopes` request.
2018
'returnValue': Scope contains one or more return values.
2019
etc.
2020
*/
2021
presentationHint?: 'arguments' | 'locals' | 'registers' | 'returnValue' | string;
2022
/** The variables of this scope can be retrieved by passing the value of `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. */
2023
variablesReference: number;
2024
/** The number of named variables in this scope.
2025
The client can use this information to present the variables in a paged UI and fetch them in chunks.
2026
*/
2027
namedVariables?: number;
2028
/** The number of indexed variables in this scope.
2029
The client can use this information to present the variables in a paged UI and fetch them in chunks.
2030
*/
2031
indexedVariables?: number;
2032
/** If true, the number of variables in this scope is large or expensive to retrieve. */
2033
expensive: boolean;
2034
/** The source for this scope. */
2035
source?: Source;
2036
/** The start line of the range covered by this scope. */
2037
line?: number;
2038
/** Start position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
2039
column?: number;
2040
/** The end line of the range covered by this scope. */
2041
endLine?: number;
2042
/** End position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
2043
endColumn?: number;
2044
}
2045
2046
/** A Variable is a name/value pair.
2047
The `type` attribute is shown if space permits or when hovering over the variable's name.
2048
The `kind` attribute is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private.
2049
If the value is structured (has children), a handle is provided to retrieve the children with the `variables` request.
2050
If the number of named or indexed children is large, the numbers should be returned via the `namedVariables` and `indexedVariables` attributes.
2051
The client can use this information to present the children in a paged UI and fetch them in chunks.
2052
*/
2053
interface Variable {
2054
/** The variable's name. */
2055
name: string;
2056
/** The variable's value.
2057
This can be a multi-line text, e.g. for a function the body of a function.
2058
For structured variables (which do not have a simple value), it is recommended to provide a one-line representation of the structured object. This helps to identify the structured object in the collapsed state when its children are not yet visible.
2059
An empty string can be used if no value should be shown in the UI.
2060
*/
2061
value: string;
2062
/** The type of the variable's value. Typically shown in the UI when hovering over the value.
2063
This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true.
2064
*/
2065
type?: string;
2066
/** Properties of a variable that can be used to determine how to render the variable in the UI. */
2067
presentationHint?: VariablePresentationHint;
2068
/** The evaluatable name of this variable which can be passed to the `evaluate` request to fetch the variable's value. */
2069
evaluateName?: string;
2070
/** If `variablesReference` is > 0, the variable is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details. */
2071
variablesReference: number;
2072
/** The number of named child variables.
2073
The client can use this information to present the children in a paged UI and fetch them in chunks.
2074
*/
2075
namedVariables?: number;
2076
/** The number of indexed child variables.
2077
The client can use this information to present the children in a paged UI and fetch them in chunks.
2078
*/
2079
indexedVariables?: number;
2080
/** A memory reference associated with this variable.
2081
For pointer type variables, this is generally a reference to the memory address contained in the pointer.
2082
For executable data, this reference may later be used in a `disassemble` request.
2083
This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
2084
*/
2085
memoryReference?: string;
2086
/** A reference that allows the client to request the location where the variable is declared. This should be present only if the adapter is likely to be able to resolve the location.
2087
2088
This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
2089
*/
2090
declarationLocationReference?: number;
2091
/** A reference that allows the client to request the location where the variable's value is declared. For example, if the variable contains a function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
2092
2093
This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
2094
*/
2095
valueLocationReference?: number;
2096
}
2097
2098
/** Properties of a variable that can be used to determine how to render the variable in the UI. */
2099
interface VariablePresentationHint {
2100
/** The kind of variable. Before introducing additional values, try to use the listed values.
2101
Values:
2102
'property': Indicates that the object is a property.
2103
'method': Indicates that the object is a method.
2104
'class': Indicates that the object is a class.
2105
'data': Indicates that the object is data.
2106
'event': Indicates that the object is an event.
2107
'baseClass': Indicates that the object is a base class.
2108
'innerClass': Indicates that the object is an inner class.
2109
'interface': Indicates that the object is an interface.
2110
'mostDerivedClass': Indicates that the object is the most derived class.
2111
'virtual': Indicates that the object is virtual, that means it is a synthetic object introduced by the adapter for rendering purposes, e.g. an index range for large arrays.
2112
'dataBreakpoint': Deprecated: Indicates that a data breakpoint is registered for the object. The `hasDataBreakpoint` attribute should generally be used instead.
2113
etc.
2114
*/
2115
kind?: 'property' | 'method' | 'class' | 'data' | 'event' | 'baseClass' | 'innerClass' | 'interface' | 'mostDerivedClass' | 'virtual' | 'dataBreakpoint' | string;
2116
/** Set of attributes represented as an array of strings. Before introducing additional values, try to use the listed values.
2117
Values:
2118
'static': Indicates that the object is static.
2119
'constant': Indicates that the object is a constant.
2120
'readOnly': Indicates that the object is read only.
2121
'rawString': Indicates that the object is a raw string.
2122
'hasObjectId': Indicates that the object can have an Object ID created for it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.
2123
'canHaveObjectId': Indicates that the object has an Object ID associated with it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.
2124
'hasSideEffects': Indicates that the evaluation had side effects.
2125
'hasDataBreakpoint': Indicates that the object has its value tracked by a data breakpoint.
2126
etc.
2127
*/
2128
attributes?: ('static' | 'constant' | 'readOnly' | 'rawString' | 'hasObjectId' | 'canHaveObjectId' | 'hasSideEffects' | 'hasDataBreakpoint' | string)[];
2129
/** Visibility of variable. Before introducing additional values, try to use the listed values.
2130
Values: 'public', 'private', 'protected', 'internal', 'final', etc.
2131
*/
2132
visibility?: 'public' | 'private' | 'protected' | 'internal' | 'final' | string;
2133
/** If true, clients can present the variable with a UI that supports a specific gesture to trigger its evaluation.
2134
This mechanism can be used for properties that require executing code when retrieving their value and where the code execution can be expensive and/or produce side-effects. A typical example are properties based on a getter function.
2135
Please note that in addition to the `lazy` flag, the variable's `variablesReference` is expected to refer to a variable that will provide the value through another `variable` request.
2136
*/
2137
lazy?: boolean;
2138
}
2139
2140
/** Properties of a breakpoint location returned from the `breakpointLocations` request. */
2141
interface BreakpointLocation {
2142
/** Start line of breakpoint location. */
2143
line: number;
2144
/** The start position of a breakpoint location. Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
2145
column?: number;
2146
/** The end line of breakpoint location if the location covers a range. */
2147
endLine?: number;
2148
/** The end position of a breakpoint location (if the location covers a range). Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
2149
endColumn?: number;
2150
}
2151
2152
/** Properties of a breakpoint or logpoint passed to the `setBreakpoints` request. */
2153
interface SourceBreakpoint {
2154
/** The source line of the breakpoint or logpoint. */
2155
line: number;
2156
/** Start position within source line of the breakpoint or logpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
2157
column?: number;
2158
/** The expression for conditional breakpoints.
2159
It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true.
2160
*/
2161
condition?: string;
2162
/** The expression that controls how many hits of the breakpoint are ignored.
2163
The debug adapter is expected to interpret the expression as needed.
2164
The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true.
2165
If both this property and `condition` are specified, `hitCondition` should be evaluated only if the `condition` is met, and the debug adapter should stop only if both conditions are met.
2166
*/
2167
hitCondition?: string;
2168
/** If this attribute exists and is non-empty, the debug adapter must not 'break' (stop)
2169
but log the message instead. Expressions within `{}` are interpolated.
2170
The attribute is only honored by a debug adapter if the corresponding capability `supportsLogPoints` is true.
2171
If either `hitCondition` or `condition` is specified, then the message should only be logged if those conditions are met.
2172
*/
2173
logMessage?: string;
2174
/** The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. */
2175
mode?: string;
2176
}
2177
2178
/** Properties of a breakpoint passed to the `setFunctionBreakpoints` request. */
2179
interface FunctionBreakpoint {
2180
/** The name of the function. */
2181
name: string;
2182
/** An expression for conditional breakpoints.
2183
It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true.
2184
*/
2185
condition?: string;
2186
/** An expression that controls how many hits of the breakpoint are ignored.
2187
The debug adapter is expected to interpret the expression as needed.
2188
The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true.
2189
*/
2190
hitCondition?: string;
2191
}
2192
2193
/** This enumeration defines all possible access types for data breakpoints. */
2194
type DataBreakpointAccessType = 'read' | 'write' | 'readWrite';
2195
2196
/** Properties of a data breakpoint passed to the `setDataBreakpoints` request. */
2197
interface DataBreakpoint {
2198
/** An id representing the data. This id is returned from the `dataBreakpointInfo` request. */
2199
dataId: string;
2200
/** The access type of the data. */
2201
accessType?: DataBreakpointAccessType;
2202
/** An expression for conditional breakpoints. */
2203
condition?: string;
2204
/** An expression that controls how many hits of the breakpoint are ignored.
2205
The debug adapter is expected to interpret the expression as needed.
2206
*/
2207
hitCondition?: string;
2208
}
2209
2210
/** Properties of a breakpoint passed to the `setInstructionBreakpoints` request */
2211
interface InstructionBreakpoint {
2212
/** The instruction reference of the breakpoint.
2213
This should be a memory or instruction pointer reference from an `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or `Breakpoint`.
2214
*/
2215
instructionReference: string;
2216
/** The offset from the instruction reference in bytes.
2217
This can be negative.
2218
*/
2219
offset?: number;
2220
/** An expression for conditional breakpoints.
2221
It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true.
2222
*/
2223
condition?: string;
2224
/** An expression that controls how many hits of the breakpoint are ignored.
2225
The debug adapter is expected to interpret the expression as needed.
2226
The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true.
2227
*/
2228
hitCondition?: string;
2229
/** The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. */
2230
mode?: string;
2231
}
2232
2233
/** Information about a breakpoint created in `setBreakpoints`, `setFunctionBreakpoints`, `setInstructionBreakpoints`, or `setDataBreakpoints` requests. */
2234
interface Breakpoint {
2235
/** The identifier for the breakpoint. It is needed if breakpoint events are used to update or remove breakpoints. */
2236
id?: number;
2237
/** If true, the breakpoint could be set (but not necessarily at the desired location). */
2238
verified: boolean;
2239
/** A message about the state of the breakpoint.
2240
This is shown to the user and can be used to explain why a breakpoint could not be verified.
2241
*/
2242
message?: string;
2243
/** The source where the breakpoint is located. */
2244
source?: Source;
2245
/** The start line of the actual range covered by the breakpoint. */
2246
line?: number;
2247
/** Start position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
2248
column?: number;
2249
/** The end line of the actual range covered by the breakpoint. */
2250
endLine?: number;
2251
/** End position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
2252
If no end line is given, then the end column is assumed to be in the start line.
2253
*/
2254
endColumn?: number;
2255
/** A memory reference to where the breakpoint is set. */
2256
instructionReference?: string;
2257
/** The offset from the instruction reference.
2258
This can be negative.
2259
*/
2260
offset?: number;
2261
/** A machine-readable explanation of why a breakpoint may not be verified. If a breakpoint is verified or a specific reason is not known, the adapter should omit this property. Possible values include:
2262
2263
- `pending`: Indicates a breakpoint might be verified in the future, but the adapter cannot verify it in the current state.
2264
- `failed`: Indicates a breakpoint was not able to be verified, and the adapter does not believe it can be verified without intervention.
2265
*/
2266
reason?: 'pending' | 'failed';
2267
}
2268
2269
/** The granularity of one 'step' in the stepping requests `next`, `stepIn`, `stepOut`, and `stepBack`.
2270
'statement': The step should allow the program to run until the current statement has finished executing.
2271
The meaning of a statement is determined by the adapter and it may be considered equivalent to a line.
2272
For example 'for(int i = 0; i < 10; i++)' could be considered to have 3 statements 'int i = 0', 'i < 10', and 'i++'.
2273
'line': The step should allow the program to run until the current source line has executed.
2274
'instruction': The step should allow one instruction to execute (e.g. one x86 instruction).
2275
*/
2276
type SteppingGranularity = 'statement' | 'line' | 'instruction';
2277
2278
/** A `StepInTarget` can be used in the `stepIn` request and determines into which single target the `stepIn` request should step. */
2279
interface StepInTarget {
2280
/** Unique identifier for a step-in target. */
2281
id: number;
2282
/** The name of the step-in target (shown in the UI). */
2283
label: string;
2284
/** The line of the step-in target. */
2285
line?: number;
2286
/** Start position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
2287
column?: number;
2288
/** The end line of the range covered by the step-in target. */
2289
endLine?: number;
2290
/** End position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. */
2291
endColumn?: number;
2292
}
2293
2294
/** A `GotoTarget` describes a code location that can be used as a target in the `goto` request.
2295
The possible goto targets can be determined via the `gotoTargets` request.
2296
*/
2297
interface GotoTarget {
2298
/** Unique identifier for a goto target. This is used in the `goto` request. */
2299
id: number;
2300
/** The name of the goto target (shown in the UI). */
2301
label: string;
2302
/** The line of the goto target. */
2303
line: number;
2304
/** The column of the goto target. */
2305
column?: number;
2306
/** The end line of the range covered by the goto target. */
2307
endLine?: number;
2308
/** The end column of the range covered by the goto target. */
2309
endColumn?: number;
2310
/** A memory reference for the instruction pointer value represented by this target. */
2311
instructionPointerReference?: string;
2312
}
2313
2314
/** `CompletionItems` are the suggestions returned from the `completions` request. */
2315
interface CompletionItem {
2316
/** The label of this completion item. By default this is also the text that is inserted when selecting this completion. */
2317
label: string;
2318
/** If text is returned and not an empty string, then it is inserted instead of the label. */
2319
text?: string;
2320
/** A string that should be used when comparing this item with other items. If not returned or an empty string, the `label` is used instead. */
2321
sortText?: string;
2322
/** A human-readable string with additional information about this item, like type or symbol information. */
2323
detail?: string;
2324
/** The item's type. Typically the client uses this information to render the item in the UI with an icon. */
2325
type?: CompletionItemType;
2326
/** Start position (within the `text` attribute of the `completions` request) where the completion text is added. The position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If the start position is omitted the text is added at the location specified by the `column` attribute of the `completions` request. */
2327
start?: number;
2328
/** Length determines how many characters are overwritten by the completion text and it is measured in UTF-16 code units. If missing the value 0 is assumed which results in the completion text being inserted. */
2329
length?: number;
2330
/** Determines the start of the new selection after the text has been inserted (or replaced). `selectionStart` is measured in UTF-16 code units and must be in the range 0 and length of the completion text. If omitted the selection starts at the end of the completion text. */
2331
selectionStart?: number;
2332
/** Determines the length of the new selection after the text has been inserted (or replaced) and it is measured in UTF-16 code units. The selection can not extend beyond the bounds of the completion text. If omitted the length is assumed to be 0. */
2333
selectionLength?: number;
2334
}
2335
2336
/** Some predefined types for the CompletionItem. Please note that not all clients have specific icons for all of them. */
2337
type CompletionItemType = 'method' | 'function' | 'constructor' | 'field' | 'variable' | 'class' | 'interface' | 'module' | 'property' | 'unit' | 'value' | 'enum' | 'keyword' | 'snippet' | 'text' | 'color' | 'file' | 'reference' | 'customcolor';
2338
2339
/** Names of checksum algorithms that may be supported by a debug adapter. */
2340
type ChecksumAlgorithm = 'MD5' | 'SHA1' | 'SHA256' | 'timestamp';
2341
2342
/** The checksum of an item calculated by the specified algorithm. */
2343
interface Checksum {
2344
/** The algorithm used to calculate this checksum. */
2345
algorithm: ChecksumAlgorithm;
2346
/** Value of the checksum, encoded as a hexadecimal value. */
2347
checksum: string;
2348
}
2349
2350
/** Provides formatting information for a value. */
2351
interface ValueFormat {
2352
/** Display the value in hex. */
2353
hex?: boolean;
2354
}
2355
2356
/** Provides formatting information for a stack frame. */
2357
interface StackFrameFormat extends ValueFormat {
2358
/** Displays parameters for the stack frame. */
2359
parameters?: boolean;
2360
/** Displays the types of parameters for the stack frame. */
2361
parameterTypes?: boolean;
2362
/** Displays the names of parameters for the stack frame. */
2363
parameterNames?: boolean;
2364
/** Displays the values of parameters for the stack frame. */
2365
parameterValues?: boolean;
2366
/** Displays the line number of the stack frame. */
2367
line?: boolean;
2368
/** Displays the module of the stack frame. */
2369
module?: boolean;
2370
/** Includes all stack frames, including those the debug adapter might otherwise hide. */
2371
includeAll?: boolean;
2372
}
2373
2374
/** An `ExceptionFilterOptions` is used to specify an exception filter together with a condition for the `setExceptionBreakpoints` request. */
2375
interface ExceptionFilterOptions {
2376
/** ID of an exception filter returned by the `exceptionBreakpointFilters` capability. */
2377
filterId: string;
2378
/** An expression for conditional exceptions.
2379
The exception breaks into the debugger if the result of the condition is true.
2380
*/
2381
condition?: string;
2382
/** The mode of this exception breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`. */
2383
mode?: string;
2384
}
2385
2386
/** An `ExceptionOptions` assigns configuration options to a set of exceptions. */
2387
interface ExceptionOptions {
2388
/** A path that selects a single or multiple exceptions in a tree. If `path` is missing, the whole tree is selected.
2389
By convention the first segment of the path is a category that is used to group exceptions in the UI.
2390
*/
2391
path?: ExceptionPathSegment[];
2392
/** Condition when a thrown exception should result in a break. */
2393
breakMode: ExceptionBreakMode;
2394
}
2395
2396
/** This enumeration defines all possible conditions when a thrown exception should result in a break.
2397
never: never breaks,
2398
always: always breaks,
2399
unhandled: breaks when exception unhandled,
2400
userUnhandled: breaks if the exception is not handled by user code.
2401
*/
2402
type ExceptionBreakMode = 'never' | 'always' | 'unhandled' | 'userUnhandled';
2403
2404
/** An `ExceptionPathSegment` represents a segment in a path that is used to match leafs or nodes in a tree of exceptions.
2405
If a segment consists of more than one name, it matches the names provided if `negate` is false or missing, or it matches anything except the names provided if `negate` is true.
2406
*/
2407
interface ExceptionPathSegment {
2408
/** If false or missing this segment matches the names provided, otherwise it matches anything except the names provided. */
2409
negate?: boolean;
2410
/** Depending on the value of `negate` the names that should match or not match. */
2411
names: string[];
2412
}
2413
2414
/** Detailed information about an exception that has occurred. */
2415
interface ExceptionDetails {
2416
/** Message contained in the exception. */
2417
message?: string;
2418
/** Short type name of the exception object. */
2419
typeName?: string;
2420
/** Fully-qualified type name of the exception object. */
2421
fullTypeName?: string;
2422
/** An expression that can be evaluated in the current scope to obtain the exception object. */
2423
evaluateName?: string;
2424
/** Stack trace at the time the exception was thrown. */
2425
stackTrace?: string;
2426
/** Details of the exception contained by this exception, if any. */
2427
innerException?: ExceptionDetails[];
2428
}
2429
2430
/** Represents a single disassembled instruction. */
2431
interface DisassembledInstruction {
2432
/** The address of the instruction. Treated as a hex value if prefixed with `0x`, or as a decimal value otherwise. */
2433
address: string;
2434
/** Raw bytes representing the instruction and its operands, in an implementation-defined format. */
2435
instructionBytes?: string;
2436
/** Text representing the instruction and its operands, in an implementation-defined format. */
2437
instruction: string;
2438
/** Name of the symbol that corresponds with the location of this instruction, if any. */
2439
symbol?: string;
2440
/** Source location that corresponds to this instruction, if any.
2441
Should always be set (if available) on the first instruction returned,
2442
but can be omitted afterwards if this instruction maps to the same source file as the previous instruction.
2443
*/
2444
location?: Source;
2445
/** The line within the source location that corresponds to this instruction, if any. */
2446
line?: number;
2447
/** The column within the line that corresponds to this instruction, if any. */
2448
column?: number;
2449
/** The end line of the range that corresponds to this instruction, if any. */
2450
endLine?: number;
2451
/** The end column of the range that corresponds to this instruction, if any. */
2452
endColumn?: number;
2453
/** A hint for how to present the instruction in the UI.
2454
2455
A value of `invalid` may be used to indicate this instruction is 'filler' and cannot be reached by the program. For example, unreadable memory addresses may be presented is 'invalid.'
2456
*/
2457
presentationHint?: 'normal' | 'invalid';
2458
}
2459
2460
/** Logical areas that can be invalidated by the `invalidated` event.
2461
Values:
2462
'all': All previously fetched data has become invalid and needs to be refetched.
2463
'stacks': Previously fetched stack related data has become invalid and needs to be refetched.
2464
'threads': Previously fetched thread related data has become invalid and needs to be refetched.
2465
'variables': Previously fetched variable data has become invalid and needs to be refetched.
2466
etc.
2467
*/
2468
type InvalidatedAreas = 'all' | 'stacks' | 'threads' | 'variables' | string;
2469
2470
/** A `BreakpointMode` is provided as a option when setting breakpoints on sources or instructions. */
2471
interface BreakpointMode {
2472
/** The internal ID of the mode. This value is passed to the `setBreakpoints` request. */
2473
mode: string;
2474
/** The name of the breakpoint mode. This is shown in the UI. */
2475
label: string;
2476
/** A help text providing additional information about the breakpoint mode. This string is typically shown as a hover and can be translated. */
2477
description?: string;
2478
/** Describes one or more type of breakpoint this mode applies to. */
2479
appliesTo: BreakpointModeApplicability[];
2480
}
2481
2482
/** Describes one or more type of breakpoint a `BreakpointMode` applies to. This is a non-exhaustive enumeration and may expand as future breakpoint types are added.
2483
Values:
2484
'source': In `SourceBreakpoint`s
2485
'exception': In exception breakpoints applied in the `ExceptionFilterOptions`
2486
'data': In data breakpoints requested in the `DataBreakpointInfo` request
2487
'instruction': In `InstructionBreakpoint`s
2488
etc.
2489
*/
2490
type BreakpointModeApplicability = 'source' | 'exception' | 'data' | 'instruction' | string;
2491
}
2492
2493
2494