216
}
217
}
219
>
export interface AdapterEndEvent {
220
>
error?: Error;
221
>
sessionLengthInSeconds: number;
222
>
emittedStopped: boolean;
223
>
}
224
>
225
>
export interface LoadedSourceEvent {
226
>
reason: 'new' | 'changed' | 'removed';
227
>
source: Source;
228
>
}
229
>
230
>
export type IDebugSessionReplMode = 'separate' | 'mergeWithParent';
231
>
232
>
export interface IDebugTestRunReference {
233
>
runId: string;
234
>
taskId: string;
235
>
}
236
>
237
>
export interface IDebugSessionOptions {
238
>
noDebug?: boolean;
239
>
parentSession?: IDebugSession;
240
>
lifecycleManagedByParent?: boolean;
241
>
repl?: IDebugSessionReplMode;
242
>
compoundRoot?: DebugCompoundRoot;
243
>
compact?: boolean;
244
>
startedByUser?: boolean;
245
>
saveBeforeRestart?: boolean;
246
>
suppressDebugToolbar?: boolean;
247
>
suppressDebugStatusbar?: boolean;
248
>
suppressDebugView?: boolean;
249
>
/**
250
>
* Set if the debug session is correlated with a test run. Stopping/restarting
251
>
* the session will instead stop/restart the test run.
252
>
*/
253
>
testRun?: IDebugTestRunReference;
254
>
}
255
>
256
>
export interface IDataBreakpointInfoResponse {
257
>
dataId: string | null;
258
>
description: string;
259
>
canPersist?: boolean;
260
>
accessTypes?: DebugProtocol.DataBreakpointAccessType[];
261
>
}
262
>
263
>
export interface IMemoryInvalidationEvent {
264
>
fromOffset: number;
265
>
toOffset: number;
266
>
}
267
>
268
>
export const enum MemoryRangeType {
269
>
Valid,
270
>
Unreadable,
271
>
Error,
272
>
}
273
>
274
>
export interface IMemoryRange {
275
>
type: MemoryRangeType;
276
>
offset: number;
277
>
length: number;
278
>
}
279
>
280
>
export interface IValidMemoryRange extends IMemoryRange {
281
>
type: MemoryRangeType.Valid;
282
>
offset: number;
283
>
length: number;
284
>
data: VSBuffer;
285
>
}
286
>
287
>
export interface IUnreadableMemoryRange extends IMemoryRange {
288
>
type: MemoryRangeType.Unreadable;
289
>
}
290
>
291
>
export interface IErrorMemoryRange extends IMemoryRange {
292
>
type: MemoryRangeType.Error;
293
>
error: string;
294
>
}
295
>
296
>
/**
297
>
* Union type of memory that can be returned from read(). Since a read request
298
>
* could encompass multiple previously-read ranges, multiple of these types
299
>
* are possible to return.
300
>
*/
301
>
export type MemoryRange = IValidMemoryRange | IUnreadableMemoryRange | IErrorMemoryRange;
302
>
303
>
export const DEBUG_MEMORY_SCHEME = 'vscode-debug-memory';
304
>
305
>
/**
306
>
* An IMemoryRegion corresponds to a contiguous range of memory referred to
307
>
* by a DAP `memoryReference`.
308
>
*/
309
>
export interface IMemoryRegion extends IDisposable {
310
>
/**
311
>
* Event that fires when memory changes. Can be a result of memory events or
312
>
* `write` requests.
313
>
*/
314
>
readonly onDidInvalidate: Event<IMemoryInvalidationEvent>;
315
>
316
>
/**
317
>
* Whether writes are supported on this memory region.
318
>
*/
319
>
readonly writable: boolean;
320
>
321
>
/**
322
>
* Requests memory ranges from the debug adapter. It returns a list of memory
323
>
* ranges that overlap (but may exceed!) the given offset. Use the `offset`
324
>
* and `length` of each range for display.
325
>
*/
326
>
read(fromOffset: number, toOffset: number): Promise<MemoryRange[]>;
327
>
328
>
/**
329
>
* Writes memory to the debug adapter at the given offset.
330
>
*/
331
>
write(offset: number, data: VSBuffer): Promise<number>;
332
>
}
333
>
334
>
/** Data that can be inserted in {@link IDebugSession.appendToRepl} */
335
>
export interface INewReplElementData {
336
>
/**
337
>
* Output string to display
338
>
*/
339
>
output: string;
340
>
341
>
/**
342
>
* Expression data to display. Will result in the item being expandable in
343
>
* the REPL. Its value will be used if {@link output} is not provided.
344
>
*/
345
>
expression?: IExpression;
346
>
347
>
/**
348
>
* Output severity.
349
>
*/
350
>
sev: severity;
351
>
352
>
/**
353
>
* Originating location.
354
>
*/
355
>
source?: IReplElementSource;
356
>
}
357
>
358
>
export interface IDebugEvaluatePosition {
359
>
line: number;
360
>
column: number;
361
>
source: DebugProtocol.Source;
362
>
}
363
>
364
>
export interface IDebugLocationReferenced {
365
>
line: number;
366
>
column: number;
367
>
endLine?: number;
368
>
endColumn?: number;
369
>
source: Source;
370
>
}
371
>
372
>
export interface IDebugSession extends ITreeElement, IDisposable {
373
>
374
>
readonly configuration: IConfig;
375
>
readonly unresolvedConfiguration: IConfig | undefined;
376
>
readonly state: State;
377
>
readonly root: IWorkspaceFolder | undefined;
378
>
readonly parentSession: IDebugSession | undefined;
379
>
readonly subId: string | undefined;
380
>
readonly compact: boolean;
381
>
readonly compoundRoot: DebugCompoundRoot | undefined;
382
>
readonly saveBeforeRestart: boolean;
383
>
readonly name: string;
384
>
readonly autoExpandLazyVariables: boolean;
385
>
readonly suppressDebugToolbar: boolean;
386
>
readonly suppressDebugStatusbar: boolean;
387
>
readonly suppressDebugView: boolean;
388
>
readonly lifecycleManagedByParent: boolean;
389
>
/** Test run this debug session was spawned by */
390
>
readonly correlatedTestRun?: LiveTestResult;
391
>
392
>
setSubId(subId: string | undefined): void;
393
>
394
>
getMemory(memoryReference: string): IMemoryRegion;
395
>
396
>
setName(name: string): void;
397
>
readonly onDidChangeName: Event<string>;
398
>
getLabel(): string;
399
>
400
>
getSourceForUri(modelUri: uri): Source | undefined;
401
>
getSource(raw?: DebugProtocol.Source): Source;
402
>
403
>
setConfiguration(configuration: { resolved: IConfig; unresolved: IConfig | undefined }): void;
404
>
rawUpdate(data: IRawModelUpdate): void;
405
>
406
>
getThread(threadId: number): IThread | undefined;
407
>
getAllThreads(): IThread[];
408
>
clearThreads(removeThreads: boolean, reference?: number): void;
409
>
getStoppedDetails(): IRawStoppedDetails | undefined;
410
>
411
>
getReplElements(): IReplElement[];
412
>
hasSeparateRepl(): boolean;
413
>
removeReplExpressions(): void;
414
>
addReplExpression(stackFrame: IStackFrame | undefined, name: string): Promise<void>;
415
>
appendToRepl(data: INewReplElementData): void;
416
>
/** Cancel any associated test run set through the DebugSessionOptions */
417
>
cancelCorrelatedTestRun(): void;
418
>
419
>
// session events
420
>
readonly onDidEndAdapter: Event<AdapterEndEvent | undefined>;
421
>
readonly onDidChangeState: Event<void>;
422
>
readonly onDidChangeReplElements: Event<IReplElement | undefined>;
423
>
424
>
/** DA capabilities. Set only when there is a running session available. */
425
>
readonly capabilities: DebugProtocol.Capabilities;
426
>
/** DA capabilities. These are retained on the session even after is implementation ends. */
427
>
readonly rememberedCapabilities?: DebugProtocol.Capabilities;
428
>
429
>
// DAP events
430
>
431
>
readonly onDidLoadedSource: Event<LoadedSourceEvent>;
432
>
readonly onDidCustomEvent: Event<DebugProtocol.Event>;
433
>
readonly onDidProgressStart: Event<DebugProtocol.ProgressStartEvent>;
434
>
readonly onDidProgressUpdate: Event<DebugProtocol.ProgressUpdateEvent>;
435
>
readonly onDidProgressEnd: Event<DebugProtocol.ProgressEndEvent>;
436
>
readonly onDidInvalidateMemory: Event<DebugProtocol.MemoryEvent>;
437
>
438
>
// DAP request
439
>
440
>
initialize(dbgr: IDebugger): Promise<void>;
441
>
launchOrAttach(config: IConfig): Promise<void>;
442
>
restart(): Promise<void>;
443
>
terminate(restart?: boolean /* false */): Promise<void>;
444
>
disconnect(restart?: boolean /* false */, suspend?: boolean): Promise<void>;
445
>
446
>
sendBreakpoints(modelUri: uri, bpts: IBreakpoint[], sourceModified: boolean): Promise<void>;
447
>
sendFunctionBreakpoints(fbps: IFunctionBreakpoint[]): Promise<void>;
448
>
dataBreakpointInfo(name: string, variablesReference?: number, frameId?: number): Promise<IDataBreakpointInfoResponse | undefined>;
449
>
dataBytesBreakpointInfo(address: string, bytes: number): Promise<IDataBreakpointInfoResponse | undefined>;
450
>
sendDataBreakpoints(dbps: IDataBreakpoint[]): Promise<void>;
451
>
sendInstructionBreakpoints(dbps: IInstructionBreakpoint[]): Promise<void>;
452
>
sendExceptionBreakpoints(exbpts: IExceptionBreakpoint[]): Promise<void>;
453
>
breakpointsLocations(uri: uri, lineNumber: number): Promise<IPosition[]>;
454
>
getDebugProtocolBreakpoint(breakpointId: string): DebugProtocol.Breakpoint | undefined;
455
>
resolveLocationReference(locationReference: number): Promise<IDebugLocationReferenced>;
456
>
457
>
stackTrace(threadId: number, startFrame: number, levels: number, token: CancellationToken): Promise<DebugProtocol.StackTraceResponse | undefined>;
458
>
exceptionInfo(threadId: number): Promise<IExceptionInfo | undefined>;
459
>
scopes(frameId: number, threadId: number): Promise<DebugProtocol.ScopesResponse | undefined>;
460
>
variables(variablesReference: number, threadId: number | undefined, filter: 'indexed' | 'named' | undefined, start: number | undefined, count: number | undefined): Promise<DebugProtocol.VariablesResponse | undefined>;
461
>
evaluate(expression: string, frameId?: number, context?: string, location?: IDebugEvaluatePosition): Promise<DebugProtocol.EvaluateResponse | undefined>;
462
>
customRequest(request: string, args: unknown): Promise<DebugProtocol.Response | undefined>;
463
>
cancel(progressId: string): Promise<DebugProtocol.CancelResponse | undefined>;
464
>
disassemble(memoryReference: string, offset: number, instructionOffset: number, instructionCount: number): Promise<DebugProtocol.DisassembledInstruction[] | undefined>;
465
>
readMemory(memoryReference: string, offset: number, count: number): Promise<DebugProtocol.ReadMemoryResponse | undefined>;
466
>
writeMemory(memoryReference: string, offset: number, data: string, allowPartial?: boolean): Promise<DebugProtocol.WriteMemoryResponse | undefined>;
467
>
468
>
restartFrame(frameId: number, threadId: number): Promise<void>;
469
>
next(threadId: number, granularity?: DebugProtocol.SteppingGranularity): Promise<void>;
470
>
stepIn(threadId: number, targetId?: number, granularity?: DebugProtocol.SteppingGranularity): Promise<void>;
471
>
stepInTargets(frameId: number): Promise<DebugProtocol.StepInTarget[] | undefined>;
472
>
stepOut(threadId: number, granularity?: DebugProtocol.SteppingGranularity): Promise<void>;
473
>
stepBack(threadId: number, granularity?: DebugProtocol.SteppingGranularity): Promise<void>;
474
>
continue(threadId: number): Promise<void>;
475
>
reverseContinue(threadId: number): Promise<void>;
476
>
pause(threadId: number): Promise<void>;
477
>
terminateThreads(threadIds: number[]): Promise<void>;
478
>
479
>
completions(frameId: number | undefined, threadId: number, text: string, position: Position, token: CancellationToken): Promise<DebugProtocol.CompletionsResponse | undefined>;
480
>
setVariable(variablesReference: number | undefined, name: string, value: string): Promise<DebugProtocol.SetVariableResponse | undefined>;
481
>
setExpression(frameId: number, expression: string, value: string): Promise<DebugProtocol.SetExpressionResponse | undefined>;
482
>
loadSource(resource: uri): Promise<DebugProtocol.SourceResponse | undefined>;
483
>
getLoadedSources(): Promise<Source[]>;
484
>
485
>
gotoTargets(source: DebugProtocol.Source, line: number, column?: number): Promise<DebugProtocol.GotoTargetsResponse | undefined>;
486
>
goto(threadId: number, targetId: number): Promise<DebugProtocol.GotoResponse | undefined>;
487
>
}
488
>
489
>
export interface IThread extends ITreeElement {
490
>
491
>
/**
492
>
* Process the thread belongs to
493
>
*/
494
>
readonly session: IDebugSession;
495
>
496
>
/**
497
>
* Id of the thread generated by the debug adapter backend.
498
>
*/
499
>
readonly threadId: number;
500
>
501
>
/**
502
>
* Name of the thread.
503
>
*/
504
>
readonly name: string;
505
>
506
>
/**
507
>
* Information about the current thread stop event. Undefined if thread is not stopped.
508
>
*/
509
>
readonly stoppedDetails: IRawStoppedDetails | undefined;
510
>
511
>
/**
512
>
* Information about the exception if an 'exception' stopped event raised and DA supports the 'exceptionInfo' request, otherwise undefined.
513
>
*/
514
>
readonly exceptionInfo: Promise<IExceptionInfo | undefined>;
515
>
516
>
readonly stateLabel: string;
517
>
518
>
/**
519
>
* Gets the callstack if it has already been received from the debug
520
>
* adapter.
521
>
*/
522
>
getCallStack(): ReadonlyArray<IStackFrame>;
523
>
524
>
525
>
/**
526
>
* Gets the top stack frame that is not hidden if the callstack has already been received from the debug adapter
527
>
*/
528
>
getTopStackFrame(): IStackFrame | undefined;
529
>
530
>
/**
531
>
* Invalidates the callstack cache
532
>
*/
533
>
clearCallStack(): void;
534
>
535
>
/**
536
>
* Indicates whether this thread is stopped. The callstack for stopped
537
>
* threads can be retrieved from the debug adapter.
538
>
*/
539
>
readonly stopped: boolean;
540
>
541
>
next(granularity?: DebugProtocol.SteppingGranularity): Promise<void>;
542
>
stepIn(granularity?: DebugProtocol.SteppingGranularity): Promise<void>;
543
>
stepOut(granularity?: DebugProtocol.SteppingGranularity): Promise<void>;
544
>
stepBack(granularity?: DebugProtocol.SteppingGranularity): Promise<void>;
545
>
continue(): Promise<void>;
546
>
pause(): Promise<void>;
547
>
terminate(): Promise<void>;
548
>
reverseContinue(): Promise<void>;
549
>
}
550
>
551
>
export interface IScope extends IExpressionContainer {
552
>
readonly name: string;
553
>
readonly expensive: boolean;
554
>
readonly range?: IRange;
555
>
readonly hasChildren: boolean;
556
>
readonly childrenHaveBeenLoaded: boolean;
557
>
}
558
>
559
>
export interface IStackFrame extends ITreeElement {
560
>
readonly thread: IThread;
561
>
readonly name: string;
562
>
readonly presentationHint: string | undefined;
563
>
readonly frameId: number;
564
>
readonly range: IRange;
565
>
readonly source: Source;
566
>
readonly canRestart: boolean;
567
>
readonly instructionPointerReference?: string;
568
>
getScopes(): Promise<IScope[]>;
569
>
getMostSpecificScopes(range: IRange): Promise<ReadonlyArray<IScope>>;
570
>
forgetScopes(): void;
571
>
restart(): Promise<void>;
572
>
toString(): string;
573
>
openInEditor(editorService: IEditorService, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): Promise<IEditorPane | undefined>;
574
>
equals(other: IStackFrame): boolean;
575
>
}
576
>
577
>
export function isFrameDeemphasized(frame: IStackFrame): boolean {
578
const hint = frame.presentationHint ?? frame.source.presentationHint;
579
return hint === 'deemphasize' || hint === 'subtle';
580
}
582
>
export interface IEnablement extends ITreeElement {
583
>
readonly enabled: boolean;
584
>
}
585
>
586
>
export interface IBreakpointData {
587
>
readonly id?: string;
588
>
readonly lineNumber: number;
589
>
readonly column?: number;
590
>
readonly enabled?: boolean;
591
>
readonly condition?: string;
592
>
readonly logMessage?: string;
593
>
readonly hitCondition?: string;
594
>
readonly triggeredBy?: string;
595
>
readonly mode?: string;
596
>
readonly modeLabel?: string;
597
>
}
598
>
599
>
export interface IBreakpointUpdateData {
600
>
readonly condition?: string;
601
>
readonly hitCondition?: string;
602
>
readonly logMessage?: string;
603
>
readonly lineNumber?: number;
604
>
readonly column?: number;
605
>
readonly triggeredBy?: string;
606
>
readonly mode?: string;
607
>
readonly modeLabel?: string;
608
>
}
609
>
610
>
export interface IBaseBreakpoint extends IEnablement {
611
>
readonly condition?: string;
612
>
readonly hitCondition?: string;
613
>
readonly logMessage?: string;
614
>
readonly verified: boolean;
615
>
readonly supported: boolean;
616
>
readonly message?: string;
617
>
/** The preferred mode of the breakpoint from {@link DebugProtocol.BreakpointMode} */
618
>
readonly mode?: string;
619
>
/** The preferred mode label of the breakpoint from {@link DebugProtocol.BreakpointMode} */
620
>
readonly modeLabel?: string;
621
>
readonly sessionsThatVerified: string[];
622
>
getIdFromAdapter(sessionId: string): number | undefined;
623
>
}
624
>
625
>
export interface IBreakpoint extends IBaseBreakpoint {
626
>
/** URI where the breakpoint was first set by the user. */
627
>
readonly originalUri: uri;
628
>
/** URI where the breakpoint is currently shown; may be moved by debugger */
629
>
readonly uri: uri;
630
>
readonly lineNumber: number;
631
>
readonly endLineNumber?: number;
632
>
readonly column?: number;
633
>
readonly endColumn?: number;
634
>
readonly adapterData: unknown;
635
>
readonly sessionAgnosticData: { lineNumber: number; column: number | undefined };
636
>
/** An ID of the breakpoint that triggers this breakpoint. */
637
>
readonly triggeredBy?: string;
638
>
/** Pending on the trigger breakpoint, which means this breakpoint is not yet sent to DA */
639
>
readonly pending: boolean;
640
>
641
>
/** Marks that a session did trigger the breakpoint. */
642
>
setSessionDidTrigger(sessionId: string, didTrigger?: boolean): void;
643
>
/** Gets whether the `triggeredBy` condition has been met in the given sesison ID. */
644
>
getSessionDidTrigger(sessionId: string): boolean;
645
>
646
>
toDAP(): DebugProtocol.SourceBreakpoint;
647
>
}
648
>
649
>
export interface IFunctionBreakpoint extends IBaseBreakpoint {
650
>
readonly name: string;
651
>
toDAP(): DebugProtocol.FunctionBreakpoint;
652
>
}
653
>
654
>
export interface IExceptionBreakpoint extends IBaseBreakpoint {
655
>
readonly filter: string;
656
>
readonly label: string;
657
>
readonly description: string | undefined;
658
>
}
659
>
660
>
export const enum DataBreakpointSetType {
661
>
Variable,
662
>
Address,
663
>
}
664
>
665
>
/**
666
>
* Source for a data breakpoint. A data breakpoint on a variable always has a
667
>
* `dataId` because it cannot reference that variable globally, but addresses
668
>
* can request info repeated and use session-specific data.
669
>
*/
670
>
export type DataBreakpointSource =
671
>
| { type: DataBreakpointSetType.Variable; dataId: string }
672
>
| { type: DataBreakpointSetType.Address; address: string; bytes: number };
673
>
674
>
export interface IDataBreakpoint extends IBaseBreakpoint {
675
>
readonly description: string;
676
>
readonly canPersist: boolean;
677
>
readonly src: DataBreakpointSource;
678
>
readonly accessType: DebugProtocol.DataBreakpointAccessType;
679
>
toDAP(session: IDebugSession): Promise<DebugProtocol.DataBreakpoint | undefined>;
680
>
}
681
>
682
>
export interface IInstructionBreakpoint extends IBaseBreakpoint {
683
>
readonly instructionReference: string;
684
>
readonly offset?: number;
685
>
/** Original instruction memory address; display purposes only */
686
>
readonly address: bigint;
687
>
toDAP(): DebugProtocol.InstructionBreakpoint;
688
>
}
689
>
690
>
export interface IExceptionInfo {
691
>
readonly id?: string;
692
>
readonly description?: string;
693
>
readonly breakMode: string | null;
694
>
readonly details?: DebugProtocol.ExceptionDetails;
695
>
}
696
>
697
>
// model interfaces
698
>
699
>
export interface IViewModel extends ITreeElement {
700
>
/**
701
>
* Returns the focused debug session or undefined if no session is stopped.
702
>
*/
703
>
readonly focusedSession: IDebugSession | undefined;
704
>
705
>
/**
706
>
* Returns the focused thread or undefined if no thread is stopped.
707
>
*/
708
>
readonly focusedThread: IThread | undefined;
709
>
710
>
/**
711
>
* Returns the focused stack frame or undefined if there are no stack frames.
712
>
*/
713
>
readonly focusedStackFrame: IStackFrame | undefined;
714
>
715
>
setVisualizedExpression(original: IExpression, visualized: IExpression & { treeId: string } | undefined): void;
716
>
/** Returns the visualized expression if loaded, or a tree it should be visualized with, or undefined */
717
>
getVisualizedExpression(expression: IExpression): IExpression | string | undefined;
718
>
getSelectedExpression(): { expression: IExpression; settingWatch: boolean } | undefined;
719
>
setSelectedExpression(expression: IExpression | undefined, settingWatch: boolean): void;
720
>
updateViews(): void;
721
>
722
>
isMultiSessionView(): boolean;
723
>
724
>
readonly onDidFocusSession: Event<IDebugSession | undefined>;
725
>
readonly onDidFocusThread: Event<{ thread: IThread | undefined; explicit: boolean; session: IDebugSession | undefined }>;
726
>
readonly onDidFocusStackFrame: Event<{ stackFrame: IStackFrame | undefined; explicit: boolean; session: IDebugSession | undefined }>;
727
>
readonly onDidSelectExpression: Event<{ expression: IExpression; settingWatch: boolean } | undefined>;
728
>
readonly onDidEvaluateLazyExpression: Event<IExpressionContainer>;
729
>
/**
730
>
* Fired when `setVisualizedExpression`, to migrate elements currently
731
>
* rendered as `original` to the `replacement`.
732
>
*/
733
>
readonly onDidChangeVisualization: Event<{ original: IExpression; replacement: IExpression }>;
734
>
readonly onWillUpdateViews: Event<void>;
735
>
736
>
evaluateLazyExpression(expression: IExpressionContainer): void;
737
>
}
738
>
739
>
export interface IEvaluate {
740
>
evaluate(session: IDebugSession, stackFrame: IStackFrame, context: string): Promise<void>;
741
>
}
742
>
743
>
export interface IDebugModel extends ITreeElement {
744
>
getSession(sessionId: string | undefined, includeInactive?: boolean): IDebugSession | undefined;
745
>
getSessions(includeInactive?: boolean): IDebugSession[];
746
>
getBreakpoints(filter?: { uri?: uri; originalUri?: uri; lineNumber?: number; column?: number; enabledOnly?: boolean; triggeredOnly?: boolean }): ReadonlyArray<IBreakpoint>;
747
>
areBreakpointsActivated(): boolean;
748
>
getFunctionBreakpoints(): ReadonlyArray<IFunctionBreakpoint>;
749
>
getDataBreakpoints(): ReadonlyArray<IDataBreakpoint>;
750
>
751
>
/**
752
>
* Returns list of all exception breakpoints.
753
>
*/
754
>
getExceptionBreakpoints(): ReadonlyArray<IExceptionBreakpoint>;
755
>
756
>
/**
757
>
* Returns list of exception breakpoints for the given session
758
>
* @param sessionId Session id. If falsy, returns the breakpoints from the last set fallback session.
759
>
*/
760
>
getExceptionBreakpointsForSession(sessionId?: string): ReadonlyArray<IExceptionBreakpoint>;
761
>
762
>
getInstructionBreakpoints(): ReadonlyArray<IInstructionBreakpoint>;
763
>
getWatchExpressions(): ReadonlyArray<IExpression & IEvaluate>;
764
>
registerBreakpointModes(debugType: string, modes: DebugProtocol.BreakpointMode[]): void;
765
>
getBreakpointModes(forBreakpointType: 'source' | 'exception' | 'data' | 'instruction'): DebugProtocol.BreakpointMode[];
766
>
readonly onDidChangeBreakpoints: Event<IBreakpointsChangeEvent | undefined>;
767
>
readonly onDidChangeCallStack: Event<void>;
768
>
/**
769
>
* The expression has been added, removed, or repositioned.
770
>
*/
771
>
readonly onDidChangeWatchExpressions: Event<IExpression | undefined>;
772
>
/**
773
>
* The expression's value has changed.
774
>
*/
775
>
readonly onDidChangeWatchExpressionValue: Event<IExpression | undefined>;
776
>
777
>
fetchCallstack(thread: IThread, levels?: number): Promise<void>;
778
>
}
779
>
780
>
/**
781
>
* An event describing a change to the set of [breakpoints](#debug.Breakpoint).
782
>
*/
783
>
export interface IBreakpointsChangeEvent {
784
>
added?: Array<IBreakpoint | IFunctionBreakpoint | IDataBreakpoint | IInstructionBreakpoint>;
785
>
removed?: Array<IBreakpoint | IFunctionBreakpoint | IDataBreakpoint | IInstructionBreakpoint>;
786
>
changed?: Array<IBreakpoint | IFunctionBreakpoint | IDataBreakpoint | IInstructionBreakpoint>;
787
>
sessionOnly: boolean;
788
>
}
789
>
790
>
// Debug configuration interfaces
791
>
792
>
export interface IDebugConfiguration {
793
>
allowBreakpointsEverywhere: boolean;
794
>
gutterMiddleClickAction: 'logpoint' | 'conditionalBreakpoint' | 'triggeredBreakpoint' | 'none';
795
>
openDebug: 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart' | 'openOnDebugBreak';
796
>
openExplorerOnEnd: boolean;
797
>
inlineValues: boolean | 'auto' | 'on' | 'off'; // boolean for back-compat
798
>
toolBarLocation: 'floating' | 'docked' | 'commandCenter' | 'hidden';
799
>
showInStatusBar: 'never' | 'always' | 'onFirstSessionStart';
800
>
internalConsoleOptions: 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart';
801
>
extensionHostDebugAdapter: boolean;
802
>
enableAllHovers: boolean;
803
>
showSubSessionsInToolBar: boolean;
804
>
closeReadonlyTabsOnEnd: boolean;
805
>
console: {
806
>
fontSize: number;
807
>
fontFamily: string;
808
>
lineHeight: number;
809
>
wordWrap: boolean;
810
>
closeOnEnd: boolean;
811
>
collapseIdenticalLines: boolean;
812
>
historySuggestions: boolean;
813
>
acceptSuggestionOnEnter: 'off' | 'on';
814
>
maximumLines: number;
815
>
};
816
>
focusWindowOnBreak: boolean;
817
>
focusEditorOnBreak: boolean;
818
>
onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt' | 'abort';
819
>
showBreakpointsInOverviewRuler: boolean;
820
>
showInlineBreakpointCandidates: boolean;
821
>
confirmOnExit: 'always' | 'never';
822
>
disassemblyView: {
823
>
showSourceCode: boolean;
824
>
};
825
>
autoExpandLazyVariables: 'auto' | 'off' | 'on';
826
>
enableStatusBarColor: boolean;
827
>
showVariableTypes: boolean;
828
>
hideSlowPreLaunchWarning: boolean;
829
>
}
830
>
831
>
export interface IGlobalConfig {
832
>
version: string;
833
>
compounds: ICompound[];
834
>
configurations: IConfig[];
835
>
}
836
>
837
>
export interface IConfigPresentation {
838
>
hidden?: boolean;
839
>
group?: string;
840
>
order?: number;
841
>
}
842
>
843
>
interface IEnvConfig {
844
>
internalConsoleOptions?: 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart';
845
>
preRestartTask?: string | ITaskIdentifier;
846
>
postRestartTask?: string | ITaskIdentifier;
847
>
preLaunchTask?: string | ITaskIdentifier;
848
>
postDebugTask?: string | ITaskIdentifier;
849
>
debugServer?: number;
850
>
noDebug?: boolean;
851
>
suppressMultipleSessionWarning?: boolean;
852
>
presentation?: IConfigPresentation;
853
>
}
854
>
855
>
export interface IConfig extends IEnvConfig {
856
>
857
>
// fundamental attributes
858
>
type: string;
859
>
request: string;
860
>
name: string;
861
>
presentation?: IConfigPresentation;
862
>
// platform specifics
863
>
windows?: IEnvConfig;
864
>
osx?: IEnvConfig;
865
>
linux?: IEnvConfig;
866
>
867
>
// internals
868
>
__configurationTarget?: ConfigurationTarget;
869
>
__sessionId?: string;
870
>
__restart?: unknown;
871
>
__autoAttach?: boolean;
872
>
port?: number; // TODO
873
>
}
874
>
875
>
export interface ICompound {
876
>
name: string;
877
>
stopAll?: boolean;
878
>
preLaunchTask?: string | ITaskIdentifier;
879
>
configurations: (string | { name: string; folder: string })[];
880
>
presentation?: IConfigPresentation;
881
>
}
882
>
883
>
export function isDebugConfig(thing: IConfig | ICompound): thing is IConfig {
884
return 'type' in thing && 'request' in thing;
885
}
887
>
export interface IDebugAdapter extends IDisposable {
888
>
readonly onError: Event<Error>;
889
>
readonly onExit: Event<number | null>;
890
>
onRequest(callback: (request: DebugProtocol.Request) => void): void;
891
>
onEvent(callback: (event: DebugProtocol.Event) => void): void;
892
>
startSession(): Promise<void>;
893
>
sendMessage(message: DebugProtocol.ProtocolMessage): void;
894
>
sendResponse(response: DebugProtocol.Response): void;
895
>
sendRequest(command: string, args: unknown, clb: (result: DebugProtocol.Response) => void, timeout?: number): number;
896
>
stopSession(): Promise<void>;
897
>
}
898
>
899
>
export interface IDebugAdapterFactory extends ITerminalLauncher {
900
>
createDebugAdapter(session: IDebugSession): IDebugAdapter;
901
>
substituteVariables(folder: IWorkspaceFolder | undefined, config: IConfig): Promise<IConfig>;
902
>
}
903
>
904
>
export interface IDebugAdapterExecutableOptions {
905
>
cwd?: string;
906
>
env?: { [key: string]: string };
907
>
}
908
>
909
>
export interface IDebugAdapterExecutable {
910
>
readonly type: 'executable';
911
>
readonly command: string;
912
>
readonly args: string[];
913
>
readonly options?: IDebugAdapterExecutableOptions;
914
>
}
915
>
916
>
export interface IDebugAdapterServer {
917
>
readonly type: 'server';
918
>
readonly port: number;
919
>
readonly host?: string;
920
>
}
921
>
922
>
export interface IDebugAdapterNamedPipeServer {
923
>
readonly type: 'pipeServer';
924
>
readonly path: string;
925
>
}
926
>
927
>
export interface IDebugAdapterInlineImpl extends IDisposable {
928
>
readonly onDidSendMessage: Event<DebugProtocol.Message>;
929
>
handleMessage(message: DebugProtocol.Message): void;
930
>
}
931
>
932
>
export interface IDebugAdapterImpl {
933
>
readonly type: 'implementation';
934
>
}
935
>
936
>
export type IAdapterDescriptor = IDebugAdapterExecutable | IDebugAdapterServer | IDebugAdapterNamedPipeServer | IDebugAdapterImpl;
937
>
938
>
export interface IPlatformSpecificAdapterContribution {
939
>
program?: string;
940
>
args?: string[];
941
>
runtime?: string;
942
>
runtimeArgs?: string[];
943
>
}
944
>
945
>
export interface IDebuggerContribution extends IPlatformSpecificAdapterContribution {
946
>
type: string;
947
>
label?: string;
948
>
win?: IPlatformSpecificAdapterContribution;
949
>
winx86?: IPlatformSpecificAdapterContribution;
950
>
windows?: IPlatformSpecificAdapterContribution;
951
>
osx?: IPlatformSpecificAdapterContribution;
952
>
linux?: IPlatformSpecificAdapterContribution;
953
>
954
>
// internal
955
>
aiKey?: string;
956
>
957
>
// supported languages
958
>
languages?: string[];
959
>
960
>
// debug configuration support
961
>
configurationAttributes?: Record<string, IJSONSchema>;
962
>
initialConfigurations?: unknown[];
963
>
configurationSnippets?: IJSONSchemaSnippet[];
964
>
variables?: { [key: string]: string };
965
>
when?: string;
966
>
hiddenWhen?: string;
967
>
deprecated?: string;
968
>
strings?: { [key in DebuggerString]: string };
969
>
/** @deprecated */
970
>
uiMessages?: { [key in DebuggerString]: string };
971
>
}
972
>
973
>
export interface IBreakpointContribution {
974
>
language: string;
975
>
when?: string;
976
>
}
977
>
978
>
export enum DebugConfigurationProviderTriggerKind {
979
>
/**
980
>
* `DebugConfigurationProvider.provideDebugConfigurations` is called to provide the initial debug configurations for a newly created launch.json.
981
>
*/
982
>
Initial = 1,
983
>
/**
984
>
* `DebugConfigurationProvider.provideDebugConfigurations` is called to provide dynamically generated debug configurations when the user asks for them through the UI (e.g. via the "Select and Start Debugging" command).
985
>
*/
986
>
Dynamic = 2
987
>
}
988
>
989
>
export interface IDebugConfigurationProvider {
990
>
readonly type: string;
991
>
readonly triggerKind: DebugConfigurationProviderTriggerKind;
992
>
resolveDebugConfiguration?(folderUri: uri | undefined, debugConfiguration: IConfig, token: CancellationToken): Promise<IConfig | null | undefined>;
993
>
resolveDebugConfigurationWithSubstitutedVariables?(folderUri: uri | undefined, debugConfiguration: IConfig, token: CancellationToken): Promise<IConfig | null | undefined>;
994
>
provideDebugConfigurations?(folderUri: uri | undefined, token: CancellationToken): Promise<IConfig[]>;
995
>
}
996
>
997
>
export interface IDebugAdapterDescriptorFactory {
998
>
readonly type: string;
999
>
createDebugAdapterDescriptor(session: IDebugSession): Promise<IAdapterDescriptor>;
1000
>
}
1001
>
1002
>
interface ITerminalLauncher {
1003
>
runInTerminal(args: DebugProtocol.RunInTerminalRequestArguments, sessionId: string): Promise<number | undefined>;
1004
>
}
1005
>
1006
>
export interface IConfigurationManager {
1007
>
1008
>
/**
1009
>
* Returns an object containing the selected launch configuration and the selected configuration name. Both these fields can be null (no folder workspace).
1010
>
*/
1011
>
readonly selectedConfiguration: {
1012
>
launch: ILaunch | undefined;
1013
>
// Potentially activates extensions
1014
>
getConfig: () => Promise<IConfig | undefined>;
1015
>
name: string | undefined;
1016
>
// Type is used when matching dynamic configurations to their corresponding provider
1017
>
type: string | undefined;
1018
>
};
1019
>
1020
>
selectConfiguration(launch: ILaunch | undefined, name?: string, config?: IConfig, dynamicConfigOptions?: { type?: string }): Promise<void>;
1021
>
1022
>
getLaunches(): ReadonlyArray<ILaunch>;
1023
>
getLaunch(workspaceUri: uri | undefined): ILaunch | undefined;
1024
>
getAllConfigurations(): { launch: ILaunch; name: string; presentation?: IConfigPresentation }[];
1025
>
removeRecentDynamicConfigurations(name: string, type: string): void;
1026
>
getRecentDynamicConfigurations(): { name: string; type: string }[];
1027
>
1028
>
/**
1029
>
* Allows to register on change of selected debug configuration.
1030
>
*/
1031
>
readonly onDidSelectConfiguration: Event<void>;
1032
>
1033
>
/**
1034
>
* Allows to register on change of selected debug configuration.
1035
>
*/
1036
>
readonly onDidChangeConfigurationProviders: Event<void>;
1037
>
1038
>
hasDebugConfigurationProvider(debugType: string, triggerKind?: DebugConfigurationProviderTriggerKind): boolean;
1039
>
getDynamicProviders(): Promise<{ label: string; type: string; pick: () => Promise<{ launch: ILaunch; config: IConfig; label: string } | undefined> }[]>;
1040
>
getDynamicConfigurationsByType(type: string, token?: CancellationToken): Promise<{ launch: ILaunch; config: IConfig; label: string }[]>;
1041
>
1042
>
registerDebugConfigurationProvider(debugConfigurationProvider: IDebugConfigurationProvider): IDisposable;
1043
>
unregisterDebugConfigurationProvider(debugConfigurationProvider: IDebugConfigurationProvider): void;
1044
>
1045
>
resolveConfigurationByProviders(folderUri: uri | undefined, type: string | undefined, debugConfiguration: unknown, token: CancellationToken): Promise<IConfig | null | undefined>;
1046
>
}
1047
>
1048
>
export enum DebuggerString {
1049
>
UnverifiedBreakpoints = 'unverifiedBreakpoints'
1050
>
}
1051
>
1052
>
export interface IAdapterManager {
1053
>
1054
>
readonly onDidRegisterDebugger: Event<void>;
1055
>
1056
>
hasEnabledDebuggers(): boolean;
1057
>
getDebugAdapterDescriptor(session: IDebugSession): Promise<IAdapterDescriptor | undefined>;
1058
>
getDebuggerLabel(type: string): string | undefined;
1059
>
someDebuggerInterestedInLanguage(language: string): boolean;
1060
>
getDebugger(type: string): IDebuggerMetadata | undefined;
1061
>
1062
>
activateDebuggers(activationEvent: string, debugType?: string): Promise<void>;
1063
>
registerDebugAdapterFactory(debugTypes: string[], debugAdapterFactory: IDebugAdapterFactory): IDisposable;
1064
>
createDebugAdapter(session: IDebugSession): IDebugAdapter | undefined;
1065
>
registerDebugAdapterDescriptorFactory(debugAdapterDescriptorFactory: IDebugAdapterDescriptorFactory): IDisposable;
1066
>
unregisterDebugAdapterDescriptorFactory(debugAdapterDescriptorFactory: IDebugAdapterDescriptorFactory): void;
1067
>
1068
>
substituteVariables(debugType: string, folder: IWorkspaceFolder | undefined, config: IConfig): Promise<IConfig>;
1069
>
runInTerminal(debugType: string, args: DebugProtocol.RunInTerminalRequestArguments, sessionId: string): Promise<number | undefined>;
1070
>
getEnabledDebugger(type: string): (IDebugger & IDebuggerMetadata) | undefined;
1071
>
guessDebugger(gettingConfigurations: boolean): Promise<IGuessedDebugger | undefined>;
1072
>
1073
>
get onDidDebuggersExtPointRead(): Event<void>;
1074
>
}
1075
>
1076
>
export interface IGuessedDebugger {
1077
>
debugger: IDebugger;
1078
>
withConfig?: {
1079
>
label: string;
1080
>
launch: ILaunch;
1081
>
config: IConfig;
1082
>
};
1083
>
}
1084
>
1085
>
export interface ILaunch {
1086
>
1087
>
/**
1088
>
* Resource pointing to the launch.json this object is wrapping.
1089
>
*/
1090
>
readonly uri: uri;
1091
>
1092
>
/**
1093
>
* Name of the launch.
1094
>
*/
1095
>
readonly name: string;
1096
>
1097
>
/**
1098
>
* Workspace of the launch. Can be undefined.
1099
>
*/
1100
>
readonly workspace: IWorkspaceFolder | undefined;
1101
>
1102
>
/**
1103
>
* Should this launch be shown in the debug dropdown.
1104
>
*/
1105
>
readonly hidden: boolean;
1106
>
1107
>
/**
1108
>
* Returns a configuration with the specified name.
1109
>
* Returns undefined if there is no configuration with the specified name.
1110
>
*/
1111
>
getConfiguration(name: string): IConfig | undefined;
1112
>
1113
>
/**
1114
>
* Returns a compound with the specified name.
1115
>
* Returns undefined if there is no compound with the specified name.
1116
>
*/
1117
>
getCompound(name: string): ICompound | undefined;
1118
>
1119
>
/**
1120
>
* Returns the names of all configurations and compounds.
1121
>
* Ignores configurations which are invalid.
1122
>
*/
1123
>
getConfigurationNames(ignoreCompoundsAndPresentation?: boolean): string[];
1124
>
1125
>
/**
1126
>
* Opens the launch.json file. Creates if it does not exist.
1127
>
*/
1128
>
openConfigFile(options: { preserveFocus: boolean; type?: string; suppressInitialConfigs?: boolean }, token?: CancellationToken): Promise<{ editor: IEditorPane | null; created: boolean }>;
1129
>
}
1130
>
1131
>
// Debug service interfaces
1132
>
1133
>
export const IDebugService = createDecorator<IDebugService>('debugService');
1134
>
1135
>
export interface IDebugService {
1136
>
readonly _serviceBrand: undefined;
1137
>
1138
>
/**
1139
>
* Gets the current debug state.
1140
>
*/
1141
>
readonly state: State;
1142
>
1143
>
readonly initializingOptions?: IDebugSessionOptions | undefined;
1144
>
1145
>
/**
1146
>
* Allows to register on debug state changes.
1147
>
*/
1148
>
readonly onDidChangeState: Event<State>;
1149
>
1150
>
/**
1151
>
* Allows to register on sessions about to be created (not yet fully initialised).
1152
>
* This is fired exactly one time for any given session.
1153
>
*/
1154
>
readonly onWillNewSession: Event<IDebugSession>;
1155
>
1156
>
/**
1157
>
* Fired when a new debug session is started. This may fire multiple times
1158
>
* for a single session due to restarts.
1159
>
*/
1160
>
readonly onDidNewSession: Event<IDebugSession>;
1161
>
1162
>
/**
1163
>
* Allows to register on end session events.
1164
>
*
1165
>
* Contains a boolean indicating whether the session will restart. If restart
1166
>
* is true, the session should not considered to be dead yet.
1167
>
*/
1168
>
readonly onDidEndSession: Event<{ session: IDebugSession; restart: boolean }>;
1169
>
1170
>
/**
1171
>
* Gets the configuration manager.
1172
>
*/
1173
>
getConfigurationManager(): IConfigurationManager;
1174
>
1175
>
/**
1176
>
* Gets the adapter manager.
1177
>
*/
1178
>
getAdapterManager(): IAdapterManager;
1179
>
1180
>
/**
1181
>
* Sets the focused stack frame and evaluates all expressions against the newly focused stack frame,
1182
>
*/
1183
>
focusStackFrame(focusedStackFrame: IStackFrame | undefined, thread?: IThread, session?: IDebugSession, options?: { explicit?: boolean; preserveFocus?: boolean; sideBySide?: boolean; pinned?: boolean }): Promise<void>;
1184
>
1185
>
/**
1186
>
* Returns true if breakpoints can be set for a given editor model. Depends on mode.
1187
>
*/
1188
>
canSetBreakpointsIn(model: EditorIModel): boolean;
1189
>
1190
>
/**
1191
>
* Adds new breakpoints to the model for the file specified with the uri. Notifies debug adapter of breakpoint changes.
1192
>
*/
1193
>
addBreakpoints(uri: uri, rawBreakpoints: IBreakpointData[], ariaAnnounce?: boolean): Promise<IBreakpoint[]>;
1194
>
1195
>
/**
1196
>
* Updates the breakpoints.
1197
>
*/
1198
>
updateBreakpoints(originalUri: uri, data: Map<string, IBreakpointUpdateData>, sendOnResourceSaved: boolean): Promise<void>;
1199
>
1200
>
/**
1201
>
* Enables or disables all breakpoints. If breakpoint is passed only enables or disables the passed breakpoint.
1202
>
* Notifies debug adapter of breakpoint changes.
1203
>
*/
1204
>
enableOrDisableBreakpoints(enable: boolean, breakpoint?: IEnablement): Promise<void>;
1205
>
1206
>
/**
1207
>
* Sets the global activated property for all breakpoints.
1208
>
* Notifies debug adapter of breakpoint changes.
1209
>
*/
1210
>
setBreakpointsActivated(activated: boolean): Promise<void>;
1211
>
1212
>
/**
1213
>
* Removes all breakpoints. If id is passed only removes the breakpoint associated with that id.
1214
>
* Notifies debug adapter of breakpoint changes.
1215
>
*/
1216
>
removeBreakpoints(id?: string | string[]): Promise<void>;
1217
>
1218
>
/**
1219
>
* Adds a new function breakpoint for the given name.
1220
>
*/
1221
>
addFunctionBreakpoint(opts?: IFunctionBreakpointOptions, id?: string): void;
1222
>
1223
>
/**
1224
>
* Updates an already existing function breakpoint.
1225
>
* Notifies debug adapter of breakpoint changes.
1226
>
*/
1227
>
updateFunctionBreakpoint(id: string, update: { name?: string; hitCondition?: string; condition?: string }): Promise<void>;
1228
>
1229
>
/**
1230
>
* Removes all function breakpoints. If id is passed only removes the function breakpoint with the passed id.
1231
>
* Notifies debug adapter of breakpoint changes.
1232
>
*/
1233
>
removeFunctionBreakpoints(id?: string): Promise<void>;
1234
>
1235
>
/**
1236
>
* Adds a new data breakpoint.
1237
>
*/
1238
>
addDataBreakpoint(opts: IDataBreakpointOptions): Promise<void>;
1239
>
1240
>
/**
1241
>
* Updates an already existing data breakpoint.
1242
>
* Notifies debug adapter of breakpoint changes.
1243
>
*/
1244
>
updateDataBreakpoint(id: string, update: { hitCondition?: string; condition?: string }): Promise<void>;
1245
>
1246
>
/**
1247
>
* Removes all data breakpoints. If id is passed only removes the data breakpoint with the passed id.
1248
>
* Notifies debug adapter of breakpoint changes.
1249
>
*/
1250
>
removeDataBreakpoints(id?: string): Promise<void>;
1251
>
1252
>
/**
1253
>
* Adds a new instruction breakpoint.
1254
>
*/
1255
>
addInstructionBreakpoint(opts: IInstructionBreakpointOptions): Promise<void>;
1256
>
1257
>
/**
1258
>
* Removes all instruction breakpoints. If `address` is passed, only the
1259
>
* instruction breakpoint with the matching resolved memory address is
1260
>
* removed; this is preferred because the debug adapter is allowed to
1261
>
* return different `instructionReference` strings for the same memory
1262
>
* location on subsequent disassemble requests. If `address` is not
1263
>
* provided, falls back to matching on `instructionReference` (and
1264
>
* `offset` when specified). When no arguments are provided, all
1265
>
* instruction breakpoints are removed. Notifies the debug adapter of
1266
>
* breakpoint changes.
1267
>
*/
1268
>
removeInstructionBreakpoints(instructionReference?: string, offset?: number, address?: bigint): Promise<void>;
1269
>
1270
>
setExceptionBreakpointCondition(breakpoint: IExceptionBreakpoint, condition: string | undefined): Promise<void>;
1271
>
1272
>
/**
1273
>
* Creates breakpoints based on the sesison filter options. This will create
1274
>
* disabled breakpoints (or enabled, if the filter indicates it's a default)
1275
>
* for each filter provided in the session.
1276
>
*/
1277
>
setExceptionBreakpointsForSession(session: IDebugSession, filters: DebugProtocol.ExceptionBreakpointsFilter[]): void;
1278
>
1279
>
/**
1280
>
* Sends all breakpoints to the passed session.
1281
>
* If session is not passed, sends all breakpoints to each session.
1282
>
*/
1283
>
sendAllBreakpoints(session?: IDebugSession): Promise<void>;
1284
>
1285
>
/**
1286
>
* Sends breakpoints of the given source to the passed session.
1287
>
*/
1288
>
sendBreakpoints(modelUri: uri, sourceModified?: boolean, session?: IDebugSession): Promise<void>;
1289
>
1290
>
/**
1291
>
* Adds a new watch expression and evaluates it against the debug adapter.
1292
>
*/
1293
>
addWatchExpression(name?: string): void;
1294
>
1295
>
/**
1296
>
* Renames a watch expression and evaluates it against the debug adapter.
1297
>
*/
1298
>
renameWatchExpression(id: string, newName: string): void;
1299
>
1300
>
/**
1301
>
* Moves a watch expression to a new possition. Used for reordering watch expressions.
1302
>
*/
1303
>
moveWatchExpression(id: string, position: number): void;
1304
>
1305
>
/**
1306
>
* Removes all watch expressions. If id is passed only removes the watch expression with the passed id.
1307
>
*/
1308
>
removeWatchExpressions(id?: string): void;
1309
>
1310
>
/**
1311
>
* Starts debugging. If the configOrName is not passed uses the selected configuration in the debug dropdown.
1312
>
* Also saves all files, manages if compounds are present in the configuration
1313
>
* and resolveds configurations via DebugConfigurationProviders.
1314
>
*
1315
>
* Returns true if the start debugging was successful. For compound launches, all configurations have to start successfully for it to return success.
1316
>
* On errors the startDebugging will throw an error, however some error and cancelations are handled and in that case will simply return false.
1317
>
*/
1318
>
startDebugging(launch: ILaunch | undefined, configOrName?: IConfig | string, options?: IDebugSessionOptions, saveBeforeStart?: boolean): Promise<boolean>;
1319
>
1320
>
/**
1321
>
* Restarts a session or creates a new one if there is no active session.
1322
>
*/
1323
>
restartSession(session: IDebugSession, restartData?: unknown): Promise<void>;
1324
>
1325
>
/**
1326
>
* Stops the session. If no session is specified then all sessions are stopped.
1327
>
*/
1328
>
stopSession(session: IDebugSession | undefined, disconnect?: boolean, suspend?: boolean): Promise<void>;
1329
>
1330
>
/**
1331
>
* Makes unavailable all sources with the passed uri. Source will appear as grayed out in callstack view.
1332
>
*/
1333
>
sourceIsNotAvailable(uri: uri): void;
1334
>
1335
>
/**
1336
>
* Gets the current debug model.
1337
>
*/
1338
>
getModel(): IDebugModel;
1339
>
1340
>
/**
1341
>
* Gets the current view model.
1342
>
*/
1343
>
getViewModel(): IViewModel;
1344
>
1345
>
/**
1346
>
* Resumes execution and pauses until the given position is reached.
1347
>
*/
1348
>
runTo(uri: uri, lineNumber: number, column?: number): Promise<void>;
1349
>
}
1350
>
1351
>
// Editor interfaces
1352
>
export const enum BreakpointWidgetContext {
1353
>
CONDITION = 0,
1354
>
HIT_COUNT = 1,
1355
>
LOG_MESSAGE = 2,
1356
>
TRIGGER_POINT = 3
1357
>
}
1358
>
1359
>
export interface IDebugEditorContribution extends editorCommon.IEditorContribution {
1360
>
showHover(range: Position, focus: boolean): Promise<void>;
1361
>
addLaunchConfiguration(): Promise<void>;
1362
>
closeExceptionWidget(): void;
1363
>
}
1364
>
1365
>
export interface IBreakpointEditorContribution extends editorCommon.IEditorContribution {
1366
>
showBreakpointWidget(lineNumber: number, column: number | undefined, context?: BreakpointWidgetContext): void;
1367
>
closeBreakpointWidget(): void;
1368
>
getContextMenuActionsAtPosition(lineNumber: number, model: EditorIModel): IAction[];
1369
>
}
1370
>
1371
>
export interface IReplConfiguration {
1372
>
readonly fontSize: number;
1373
>
readonly fontFamily: string;
1374
>
readonly lineHeight: number;
1375
>
readonly cssLineHeight: string;
1376
>
readonly backgroundColor: Color | undefined;
1377
>
readonly fontSizeForTwistie: number;
1378
>
}
1379
>
1380
>
export interface IReplOptions {
1381
>
readonly replConfiguration: IReplConfiguration;
1382
>
}
1383
>
1384
>
export interface IDebugVisualizationContext {
1385
>
variable: DebugProtocol.Variable;
1386
>
containerId?: number;
1387
>
frameId?: number;
1388
>
threadId: number;
1389
>
sessionId: string;
1390
>
}
1391
>
1392
>
export const enum DebugVisualizationType {
1393
>
Command,
1394
>
Tree,
1395
>
}
1396
>
1397
>
export type MainThreadDebugVisualization =
1398
>
| { type: DebugVisualizationType.Command }
1399
>
| { type: DebugVisualizationType.Tree; id: string };
1400
>
1401
>
1402
>
export const enum DebugTreeItemCollapsibleState {
1403
>
None = 0,
1404
>
Collapsed = 1,
1405
>
Expanded = 2
1406
>
}
1407
>
1408
>
export interface IDebugVisualizationTreeItem {
1409
>
id: number;
1410
>
label: string;
1411
>
description?: string;
1412
>
collapsibleState: DebugTreeItemCollapsibleState;
1413
>
contextValue?: string;
1414
>
canEdit?: boolean;
1415
>
}
1416
>
1417
>
export namespace IDebugVisualizationTreeItem {
1418
>
export type Serialized = IDebugVisualizationTreeItem;
1419
>
export const deserialize = (v: Serialized): IDebugVisualizationTreeItem => v;
1420
>
export const serialize = (item: IDebugVisualizationTreeItem): Serialized => item;
1421
>
}
1422
>
1423
>
export interface IDebugVisualization {
1424
>
id: number;
1425
>
name: string;
1426
>
iconPath: { light?: URI; dark: URI } | undefined;
1427
>
iconClass: string | undefined;
1428
>
visualization: MainThreadDebugVisualization | undefined;
1429
>
}
1430
>
1431
>
export namespace IDebugVisualization {
1432
>
export interface Serialized {
1433
>
id: number;
1434
>
name: string;
1435
>
iconPath?: { light?: UriComponents; dark: UriComponents };
1436
>
iconClass?: string;
1437
>
visualization?: MainThreadDebugVisualization;
1438
>
}
1439
>
1440
>
export const deserialize = (v: Serialized): IDebugVisualization => ({
1441
id: v.id,
1442
name: v.name,