/
tokens.ts
1126 lines (978 loc) · 27.3 KB
/
tokens.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor';
import { KernelMessage, Session } from '@jupyterlab/services';
import { ISharedText } from '@jupyter/ydoc';
import { ReadonlyJSONObject, Token } from '@lumino/coreutils';
import { IDisposable, IObservableDisposable } from '@lumino/disposable';
import { ISignal, Signal } from '@lumino/signaling';
import { Panel } from '@lumino/widgets';
import { DebugProtocol } from '@vscode/debugprotocol';
import { DebuggerHandler } from './handler';
/**
* An interface describing an application's visual debugger.
*/
export interface IDebugger {
/**
* Signal emitted for debug event messages.
*/
readonly eventMessage: ISignal<IDebugger, IDebugger.ISession.Event>;
/**
* Whether the current debugger is started.
*/
readonly isStarted: boolean;
/**
* Get debugger config.
*/
readonly config: IDebugger.IConfig;
/**
* A signal emitted when the pause on exception filter changes.
*/
readonly pauseOnExceptionChanged: Signal<IDebugger, void>;
/**
* The debugger service's model.
*/
readonly model: IDebugger.Model.IService;
/**
* The current debugger session.
*/
session: IDebugger.ISession | null;
/**
* Signal emitted upon session changed.
*/
readonly sessionChanged: ISignal<IDebugger, IDebugger.ISession | null>;
/**
* Removes all the breakpoints from the current notebook or console
*/
clearBreakpoints(): Promise<void>;
/**
* Used to determine if kernel has pause on exception capabilities
*/
pauseOnExceptionsIsValid(): boolean;
/**
* Add a filter to pauseOnExceptionsFilter.
*
* @param exceptionFilter - filter name.
*/
pauseOnExceptionsFilter(exceptionFilter: string): Promise<void>;
/**
* Send the pauseOnExceptions' filters to the debugger.
*/
pauseOnExceptions(exceptionFilter: string[]): Promise<void>;
/**
* Continues the execution of the current thread.
*/
continue(): Promise<void>;
/**
* Evaluate an expression.
*/
evaluate(
expression: string
): Promise<DebugProtocol.EvaluateResponse['body'] | null>;
/**
* Computes an id based on the given code.
*/
getCodeId(code: string): string;
/**
* Retrieve the content of a source file.
*
* @param source The source object containing the path to the file.
*/
getSource(source: DebugProtocol.Source): Promise<IDebugger.Source>;
/**
* Whether there exist a thread in stopped state.
*/
hasStoppedThreads(): boolean;
/**
* Request variables for a given variable reference.
*
* @param variablesReference The variable reference to request.
*/
inspectVariable(
variablesReference: number
): Promise<DebugProtocol.Variable[]>;
/**
* Request to set a variable in the global scope.
*
* @param name The name of the variable.
* @param value The value of the variable.
*/
copyToGlobals(name: string): Promise<void>;
/**
* Request rich representation of a variable.
*
* @param variableName The variable name to request
* @param frameId The current frame id in which to request the variable
* @returns The mime renderer data model
*/
inspectRichVariable(
variableName: string,
frameId?: number
): Promise<IDebugger.IRichVariable>;
/**
* Requests all the defined variables and display them in the
* table view.
*/
displayDefinedVariables(): Promise<void>;
/**
* Requests all the loaded modules and display them.
*/
displayModules(): Promise<void>;
/**
* Request whether debugging is available for the given session connection.
*
* @param connection The session connection.
*/
isAvailable(connection: Session.ISessionConnection): Promise<boolean>;
/**
* Makes the current thread run again for one step.
*/
next(): Promise<void>;
/**
* Restart the debugger.
* Precondition: isStarted
*/
restart(): Promise<void>;
/**
* Restore the state of a debug session.
*
* @param autoStart - when true, starts the debugger
* if it has not been started yet.
*/
restoreState(autoStart: boolean): Promise<void>;
/**
* Starts a debugger.
* Precondition: !isStarted
*/
start(): Promise<void>;
/**
* Makes the current thread pause if possible.
*/
pause(): Promise<void>;
/**
* Makes the current thread step in a function / method if possible.
*/
stepIn(): Promise<void>;
/**
* Makes the current thread step out a function / method if possible.
*/
stepOut(): Promise<void>;
/**
* Stops the debugger.
* Precondition: isStarted
*/
stop(): Promise<void>;
/**
* Update all breakpoints of a cell at once.
*
* @param code - The code in the cell where the breakpoints are set.
* @param breakpoints - The list of breakpoints to set.
* @param path - Optional path to the file where to set the breakpoints.
*/
updateBreakpoints(
code: string,
breakpoints: IDebugger.IBreakpoint[],
path?: string
): Promise<void>;
/**
* Get the debugger state
*
* @returns Debugger state
*/
getDebuggerState(): IDebugger.State;
/**
* Restore the debugger state
*
* @param state Debugger state
* @returns Whether the state has been restored successfully or not
*/
restoreDebuggerState(state: IDebugger.State): Promise<boolean>;
}
/**
* A namespace for visual debugger types.
*/
export namespace IDebugger {
/**
* The type for a source file.
*/
export type Source = {
/**
* The content of the source.
*/
content: string;
/**
* The mimeType of the source.
*/
mimeType?: string;
/**
* The path of the source.
*/
path: string;
};
/**
* The type for a kernel source file.
*/
export type KernelSource = {
/**
* The name of the source.
*/
name: string;
/**
* The path of the source.
*/
path: string;
};
/**
* Single breakpoint in an editor.
*/
export interface IBreakpoint extends DebugProtocol.Breakpoint {}
/*
* The state of the debugger, used for restoring a debugging session
* after restarting the kernel.
*/
export type State = {
/**
* List of cells to dump after the kernel has restarted
*/
cells: string[];
/**
* Map of breakpoints to send back to the kernel after it has restarted
*/
breakpoints: Map<string, IDebugger.IBreakpoint[]>;
};
/**
* Debugger file and hashing configuration.
*/
export interface IConfig {
/**
* Returns an id based on the given code.
*
* @param code The source code.
* @param kernel The kernel name from current session.
*/
getCodeId(code: string, kernel: string): string;
/**
* Sets the hash parameters for a kernel.
*
* @param params - Hashing parameters for a kernel.
*/
setHashParams(params: IConfig.HashParams): void;
/**
* Sets the parameters used for the temp files (e.g. cells) for a kernel.
*
* @param params - Temporary file prefix and suffix for a kernel.
*/
setTmpFileParams(params: IConfig.FileParams): void;
/**
* Gets the parameters used for the temp files (e.e. cells) for a kernel.
*
* @param kernel - The kernel name from current session.
*/
getTmpFileParams(kernel: string): IConfig.FileParams;
}
/**
* An interface for debugger handler.
*/
export interface IHandler extends DebuggerHandler.IHandler {}
/**
* Interface for interacting with source viewer.
*/
export interface ISourceViewer {
/**
* Open read-only editor for given source and optionally set a breakpoint.
*/
open(source: IDebugger.Source, breakpoint?: IDebugger.IBreakpoint): void;
}
/**
* An interface for a scope.
*/
export interface IScope {
/**
* The name of the scope.
*/
name: string;
/**
* The list of variables.
*/
variables: IVariable[];
}
/**
* A visual debugger session.
*/
export interface ISession extends IObservableDisposable {
/**
* The API session connection to connect to a debugger.
*/
connection: Session.ISessionConnection | null;
/**
* Returns the initialize response.
*/
readonly capabilities: DebugProtocol.Capabilities | undefined;
/**
* Whether the debug session is started.
*/
readonly isStarted: boolean;
/**
* Whether the debug session is pausing on exceptions.
*/
exceptionPaths: string[];
/**
* Get exception filters and default values.
*/
exceptionBreakpointFilters:
| DebugProtocol.ExceptionBreakpointsFilter[]
| undefined;
/**
* Signal emitted for debug event messages.
*/
readonly eventMessage: ISignal<
IDebugger.ISession,
IDebugger.ISession.Event
>;
/**
* Get current exception filter.
*/
currentExceptionFilters: string[];
/**
* Whether the debugger is pausing on exception.
*
* @param filter - Specify a filter
*/
isPausingOnException(filter?: string): boolean;
/**
* Restore the state of a debug session.
*/
restoreState(): Promise<IDebugger.ISession.Response['debugInfo']>;
/**
* Send a debug request to the kernel.
*/
sendRequest<K extends keyof IDebugger.ISession.Request>(
command: K,
args: IDebugger.ISession.Request[K]
): Promise<IDebugger.ISession.Response[K]>;
/**
* Start a new debug session.
*/
start(): Promise<void>;
/**
* Stop a running debug session.
*/
stop(): Promise<void>;
}
/**
* A utility to find text editors used by the debugger.
*/
export interface ISources {
/**
* Returns an array of editors for a source matching the current debug
* session by iterating through all the widgets in each of the supported
* debugger types (i.e., consoles, files, notebooks).
*
* @param params - The editor find parameters.
*/
find(params: ISources.FindParams): ISources.IEditor[];
/**
* Open a read-only editor in the main area.
*
* @param params - The editor open parameters.
*/
open(params: ISources.OpenParams): void;
}
/**
* The type for a stack frame
*/
export interface IStackFrame extends DebugProtocol.StackFrame {}
/**
* A reply to an rich inspection request.
*/
export interface IRichVariable {
/**
* The MIME bundle data returned from an rich inspection request.
*/
data: ReadonlyJSONObject;
/**
* Any metadata that accompanies the MIME bundle returning from a rich inspection request.
*/
metadata: ReadonlyJSONObject;
}
/**
* An interface for a variable.
*/
export interface IVariable extends DebugProtocol.Variable {
/**
* Whether the variable is expanded.
*/
expanded?: boolean;
}
/**
* Debugger file and hashing configuration.
*/
export namespace IConfig {
/**
* Temporary file prefix and suffix for a kernel.
*/
export type FileParams = {
/**
* The kernel name.
*/
kernel: string;
/**
* Prefix added to temporary files created by the kernel per cell.
*/
prefix: string;
/**
* Suffix added temporary files created by the kernel per cell.
*/
suffix: string;
};
/**
* Hashing parameters for a kernel.
*/
export type HashParams = {
/**
* The kernel name.
*/
kernel: string;
/**
* The hashing method.
*/
method: string;
/**
* An optional hashing seed provided by the kernel.
*/
seed?: any;
};
}
export namespace ISession {
/**
* A generic debug event.
*/
export type Event = DebugProtocol.Event;
/**
* Expose all the debug requests types.
*/
export type Request = {
attach: DebugProtocol.AttachRequestArguments;
completions: DebugProtocol.CompletionsArguments;
configurationDone: DebugProtocol.ConfigurationDoneArguments;
continue: DebugProtocol.ContinueArguments;
copyToGlobals: ICopyToGlobalsArguments;
debugInfo: Record<string, never>;
disconnect: DebugProtocol.DisconnectArguments;
dumpCell: IDumpCellArguments;
evaluate: DebugProtocol.EvaluateArguments;
exceptionInfo: DebugProtocol.ExceptionInfoArguments;
goto: DebugProtocol.GotoArguments;
gotoTargets: DebugProtocol.GotoTargetsArguments;
initialize: DebugProtocol.InitializeRequestArguments;
inspectVariables: Record<string, never>;
launch: DebugProtocol.LaunchRequestArguments;
loadedSources: DebugProtocol.LoadedSourcesArguments;
modules: DebugProtocol.ModulesArguments;
next: DebugProtocol.NextArguments;
pause: DebugProtocol.PauseArguments;
restart: DebugProtocol.RestartArguments;
restartFrame: DebugProtocol.RestartFrameArguments;
reverseContinue: DebugProtocol.ReverseContinueArguments;
richInspectVariables: IRichVariablesArguments;
scopes: DebugProtocol.ScopesArguments;
setBreakpoints: DebugProtocol.SetBreakpointsArguments;
setExceptionBreakpoints: DebugProtocol.SetExceptionBreakpointsArguments;
setExpression: DebugProtocol.SetExpressionArguments;
setFunctionBreakpoints: DebugProtocol.SetFunctionBreakpointsArguments;
setVariable: DebugProtocol.SetVariableArguments;
source: DebugProtocol.SourceArguments;
stackTrace: DebugProtocol.StackTraceArguments;
stepBack: DebugProtocol.StepBackArguments;
stepIn: DebugProtocol.StepInArguments;
stepInTargets: DebugProtocol.StepInTargetsArguments;
stepOut: DebugProtocol.StepOutArguments;
terminate: DebugProtocol.TerminateArguments;
terminateThreads: DebugProtocol.TerminateThreadsArguments;
threads: Record<string, never>;
variables: DebugProtocol.VariablesArguments;
};
/**
* Expose all the debug response types.
*/
export type Response = {
attach: DebugProtocol.AttachResponse;
completions: DebugProtocol.CompletionsResponse;
configurationDone: DebugProtocol.ConfigurationDoneResponse;
continue: DebugProtocol.ContinueResponse;
copyToGlobals: DebugProtocol.SetExpressionResponse;
debugInfo: IDebugInfoResponse;
disconnect: DebugProtocol.DisconnectResponse;
dumpCell: IDumpCellResponse;
evaluate: DebugProtocol.EvaluateResponse;
exceptionInfo: DebugProtocol.ExceptionInfoResponse;
goto: DebugProtocol.GotoResponse;
gotoTargets: DebugProtocol.GotoTargetsResponse;
initialize: DebugProtocol.InitializeResponse;
inspectVariables: IInspectVariablesResponse;
launch: DebugProtocol.LaunchResponse;
loadedSources: DebugProtocol.LoadedSourcesResponse;
modules: DebugProtocol.ModulesResponse;
next: DebugProtocol.NextResponse;
pause: DebugProtocol.PauseResponse;
restart: DebugProtocol.RestartResponse;
restartFrame: DebugProtocol.RestartFrameResponse;
reverseContinue: DebugProtocol.ReverseContinueResponse;
richInspectVariables: IRichVariablesResponse;
scopes: DebugProtocol.ScopesResponse;
setBreakpoints: DebugProtocol.SetBreakpointsResponse;
setExceptionBreakpoints: DebugProtocol.SetExceptionBreakpointsResponse;
setExpression: DebugProtocol.SetExpressionResponse;
setFunctionBreakpoints: DebugProtocol.SetFunctionBreakpointsResponse;
setVariable: DebugProtocol.SetVariableResponse;
source: DebugProtocol.SourceResponse;
stackTrace: DebugProtocol.StackTraceResponse;
stepBack: DebugProtocol.StepBackResponse;
stepIn: DebugProtocol.StepInResponse;
stepInTargets: DebugProtocol.StepInTargetsResponse;
stepOut: DebugProtocol.StepOutResponse;
terminate: DebugProtocol.TerminateResponse;
terminateThreads: DebugProtocol.TerminateThreadsResponse;
threads: DebugProtocol.ThreadsResponse;
variables: DebugProtocol.VariablesResponse;
};
/**
* Arguments for CopyToGlobals request.
* This is an addition to the Debug Adaptor protocol to support
* copying variable from Locals() to Globals() during breakpoint.
*/
export interface ICopyToGlobalsArguments {
srcVariableName: string;
dstVariableName: string;
srcFrameId: number;
}
/**
* List of breakpoints in a source file.
*/
export interface IDebugInfoBreakpoints {
source: string;
breakpoints: DebugProtocol.SourceBreakpoint[];
}
/**
* Response to 'debugInfo' request.
* This is an addition to the Debug Adapter Protocol to be able
* to retrieve the debugger state when restoring a session.
*/
export interface IDebugInfoResponse extends DebugProtocol.Response {
body: {
breakpoints: IDebugInfoBreakpoints[];
/**
* Whether the kernel supports the 'copyToGlobals' request.
*/
copyToGlobals?: boolean;
hashMethod: string;
hashSeed: number;
isStarted: boolean;
/**
* Whether the kernel supports variable rich rendering or not.
*/
richRendering?: boolean;
tmpFilePrefix: string;
tmpFileSuffix: string;
stoppedThreads: number[];
exceptionPaths: string[];
};
}
/**
* Arguments for 'dumpCell' request.
* This is an addition to the Debug Adapter Protocol to support
* setting breakpoints for cells.
*/
export interface IDumpCellArguments {
code: string;
}
/**
* Response to 'dumpCell' request.
* This is an addition to the Debug Adapter Protocol to support
* setting breakpoints for cells.
*/
export interface IDumpCellResponse extends DebugProtocol.Response {
body: {
sourcePath: string;
};
}
export interface IInspectVariablesResponse extends DebugProtocol.Response {
body: {
variables: DebugProtocol.Variable[];
};
}
/**
* Arguments for 'richVariables' request
*
* This is an addition to the Debug Adapter Protocol to support
* render rich variable representation.
*/
export interface IRichVariablesArguments {
/**
* Variable name
*/
variableName: string;
/**
* Frame Id
*/
frameId?: number;
}
/**
* Arguments for 'richVariables' request
*
* This is an addition to the Debug Adapter Protocol to support
* rich rendering of variables.
*/
export interface IRichVariablesResponse extends DebugProtocol.Response {
/**
* Variable mime type data
*/
body: IRichVariable;
}
/**
* Response to the 'kernel_info_request' request.
* This interface extends the IInfoReply by adding the `debugger` key
* that isn't part of the protocol yet.
* See this pull request for more info: https://github.com/jupyter/jupyter_client/pull/486
*/
export interface IInfoReply extends KernelMessage.IInfoReply {
debugger: boolean;
}
/**
* An interface for current exception filters.
*/
export interface IExceptionFilter {
[kernels: string]: string[];
}
}
/**
* Select variable in the variables explorer.
*
* @hidden
*
* #### Notes
* This is experimental API
*/
export interface IVariableSelection
extends Pick<
DebugProtocol.Variable,
'name' | 'type' | 'variablesReference' | 'value'
> {}
/**
* Debugger sidebar interface.
*/
export interface ISidebar extends Panel {}
/**
* A utility to find text editors used by the debugger.
*/
export namespace ISources {
/**
* Source editor interface
*/
export interface IEditor {
/**
* Editor getter
*/
get(): CodeEditor.IEditor | null;
/**
* Reveal editor
*/
reveal(): Promise<void>;
/**
* Editor source text
*/
src: ISharedText;
}
/**
* Unified parameters for the find method
*/
export type FindParams = {
/**
* Extra flag to focus on the parent widget of the editor.
*/
focus: boolean;
/**
* Name of current kernel.
*/
kernel: string;
/**
* Path of session connection.
*/
path: string;
/**
* Source path
*/
source: string;
};
/**
* Unified parameters for the open method
*/
export type OpenParams = {
/**
* The caption for the read-only editor.
*/
caption: string;
/**
* The code editor wrapper to add to the main area.
*/
editorWrapper: CodeEditorWrapper;
/**
* The label for the read-only editor.
*/
label: string;
};
}
/**
* A namespace for UI model definitions.
*/
export namespace Model {
/**
* The breakpoints UI model.
*/
export interface IBreakpoints {
/**
* Get all the breakpoints.
*/
readonly breakpoints: Map<string, IDebugger.IBreakpoint[]>;
/**
* Signal emitted when the model changes.
*/
readonly changed: ISignal<this, IDebugger.IBreakpoint[]>;
/**
* Signal emitted when a breakpoint is clicked.
*/
readonly clicked: Signal<this, IDebugger.IBreakpoint>;
/**
* Signal emitted when the breakpoints are restored.
*/
readonly restored: ISignal<this, void>;
/**
* Get the breakpoints for a given id (path).
*
* @param id The code id (path).
*/
getBreakpoints(id: string): IBreakpoint[];
/**
* Restore a map of breakpoints.
*
* @param breakpoints The map of breakpoints
*/
restoreBreakpoints(breakpoints: Map<string, IBreakpoint[]>): void;
/**
* Set the breakpoints for a given id (path).
*
* @param id The code id (path).
* @param breakpoints The list of breakpoints.
*/
setBreakpoints(id: string, breakpoints: IBreakpoint[]): void;
}
/**
* The callstack UI model.
*/
export interface ICallstack {
/**
* Signal emitted when the current frame has changed.
*/
readonly currentFrameChanged: ISignal<this, IDebugger.IStackFrame | null>;
/**
* The current frame.
*/
frame: IDebugger.IStackFrame | null;
/**
* The frames for the callstack.
*/
frames: IDebugger.IStackFrame[];
/**
* Signal emitted when the frames have changed.
*/
readonly framesChanged: ISignal<this, IDebugger.IStackFrame[]>;
}
/**
* The data model for the debugger service.
*/
export interface IService {
/**
* The breakpoints UI model.
*/
readonly breakpoints: IBreakpoints;
/**
* The callstack UI model.
*/
readonly callstack: ICallstack;
/**
* Whether the kernel support rich variable rendering based on mime type.
*/
hasRichVariableRendering: boolean;
/**
* Whether the kernel supports the copyToGlobals request.
*/
supportCopyToGlobals: boolean;
/**
* The variables UI model.
*/
readonly variables: IVariables;
/**
* The sources UI model.
*/
readonly sources: ISources;
/**
* The kernel sources UI model.
*/
readonly kernelSources: IKernelSources;
/**
* The set of threads in stopped state.
*/
stoppedThreads: Set<number>;
/**
* The current debugger title.
*/
title: string;
/**
* A signal emitted when the title changes.
*/
titleChanged: ISignal<this, string>;
/**
* Clear the model.
*/
clear(): void;
}
/**
* The sources UI model.
*/
export interface ISources {
/**
* Signal emitted when the current frame changes.
*/
readonly currentFrameChanged: ISignal<
IDebugger.Model.ICallstack,
IDebugger.IStackFrame | null
>;
/**
* Return the current source.
*/
currentSource: IDebugger.Source | null;
/**
* Signal emitted when the current source changes.
*/
readonly currentSourceChanged: ISignal<
IDebugger.Model.ISources,
IDebugger.Source | null
>;
/**
* Signal emitted when a source should be open in the main area.
*/
readonly currentSourceOpened: ISignal<
IDebugger.Model.ISources,
IDebugger.Source | null
>;
/**
* Open a source in the main area.