@jupyterlab/debugger 4.0.0-alpha.2 → 4.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/debugger.d.ts +4 -0
- package/lib/debugger.js +5 -1
- package/lib/debugger.js.map +1 -1
- package/lib/dialogs/evaluate.d.ts +5 -0
- package/lib/dialogs/evaluate.js +16 -6
- package/lib/dialogs/evaluate.js.map +1 -1
- package/lib/factory.d.ts +1 -1
- package/lib/factory.js +15 -9
- package/lib/factory.js.map +1 -1
- package/lib/handler.js +24 -9
- package/lib/handler.js.map +1 -1
- package/lib/handlers/console.js +9 -3
- package/lib/handlers/console.js.map +1 -1
- package/lib/handlers/editor.d.ts +33 -11
- package/lib/handlers/editor.js +177 -88
- package/lib/handlers/editor.js.map +1 -1
- package/lib/handlers/file.d.ts +1 -0
- package/lib/handlers/file.js +11 -2
- package/lib/handlers/file.js.map +1 -1
- package/lib/handlers/notebook.d.ts +0 -7
- package/lib/handlers/notebook.js +22 -18
- package/lib/handlers/notebook.js.map +1 -1
- package/lib/icons.d.ts +3 -0
- package/lib/icons.js +15 -0
- package/lib/icons.js.map +1 -1
- package/lib/model.d.ts +5 -0
- package/lib/model.js +4 -0
- package/lib/model.js.map +1 -1
- package/lib/panels/breakpoints/index.d.ts +18 -0
- package/lib/panels/breakpoints/index.js +10 -3
- package/lib/panels/breakpoints/index.js.map +1 -1
- package/lib/panels/breakpoints/pauseonexceptions.d.ts +53 -0
- package/lib/panels/breakpoints/pauseonexceptions.js +98 -0
- package/lib/panels/breakpoints/pauseonexceptions.js.map +1 -0
- package/lib/panels/callstack/index.d.ts +1 -1
- package/lib/panels/kernelSources/body.d.ts +45 -0
- package/lib/panels/kernelSources/body.js +76 -0
- package/lib/panels/kernelSources/body.js.map +1 -0
- package/lib/panels/kernelSources/filter.d.ts +11 -0
- package/lib/panels/kernelSources/filter.js +18 -0
- package/lib/panels/kernelSources/filter.js.map +1 -0
- package/lib/panels/kernelSources/index.d.ts +39 -0
- package/lib/panels/kernelSources/index.js +54 -0
- package/lib/panels/kernelSources/index.js.map +1 -0
- package/lib/panels/kernelSources/model.d.ts +73 -0
- package/lib/panels/kernelSources/model.js +120 -0
- package/lib/panels/kernelSources/model.js.map +1 -0
- package/lib/panels/sources/body.js +5 -3
- package/lib/panels/sources/body.js.map +1 -1
- package/lib/panels/variables/grid.d.ts +8 -2
- package/lib/panels/variables/grid.js +29 -364
- package/lib/panels/variables/grid.js.map +1 -1
- package/lib/panels/variables/gridpanel.d.ts +140 -0
- package/lib/panels/variables/gridpanel.js +363 -0
- package/lib/panels/variables/gridpanel.js.map +1 -0
- package/lib/panels/variables/index.d.ts +1 -9
- package/lib/panels/variables/index.js +1 -15
- package/lib/panels/variables/index.js.map +1 -1
- package/lib/panels/variables/mimerenderer.d.ts +15 -2
- package/lib/panels/variables/mimerenderer.js +56 -17
- package/lib/panels/variables/mimerenderer.js.map +1 -1
- package/lib/panels/variables/model.d.ts +3 -0
- package/lib/panels/variables/model.js +7 -0
- package/lib/panels/variables/model.js.map +1 -1
- package/lib/panels/variables/scope.js +4 -0
- package/lib/panels/variables/scope.js.map +1 -1
- package/lib/panels/variables/tree.d.ts +2 -5
- package/lib/panels/variables/tree.js +137 -47
- package/lib/panels/variables/tree.js.map +1 -1
- package/lib/service.d.ts +32 -2
- package/lib/service.js +122 -9
- package/lib/service.js.map +1 -1
- package/lib/session.d.ts +37 -1
- package/lib/session.js +89 -6
- package/lib/session.js.map +1 -1
- package/lib/sidebar.d.ts +7 -1
- package/lib/sidebar.js +10 -2
- package/lib/sidebar.js.map +1 -1
- package/lib/sources.d.ts +2 -2
- package/lib/sources.js +32 -17
- package/lib/sources.js.map +1 -1
- package/lib/tokens.d.ts +139 -24
- package/lib/tokens.js.map +1 -1
- package/package.json +39 -47
- package/src/config.ts +78 -0
- package/src/debugger.ts +154 -0
- package/src/dialogs/evaluate.ts +144 -0
- package/src/factory.ts +72 -0
- package/src/handler.ts +528 -0
- package/src/handlers/console.ts +118 -0
- package/src/handlers/editor.ts +469 -0
- package/src/handlers/file.ts +86 -0
- package/src/handlers/notebook.ts +128 -0
- package/src/hash.ts +69 -0
- package/src/icons.ts +64 -0
- package/src/index.ts +16 -0
- package/src/model.ts +155 -0
- package/src/panels/breakpoints/body.tsx +145 -0
- package/src/panels/breakpoints/index.ts +116 -0
- package/src/panels/breakpoints/model.ts +74 -0
- package/src/panels/breakpoints/pauseonexceptions.tsx +141 -0
- package/src/panels/callstack/body.tsx +96 -0
- package/src/panels/callstack/index.ts +152 -0
- package/src/panels/callstack/model.ts +86 -0
- package/src/panels/kernelSources/body.tsx +139 -0
- package/src/panels/kernelSources/filter.tsx +44 -0
- package/src/panels/kernelSources/index.tsx +106 -0
- package/src/panels/kernelSources/model.ts +160 -0
- package/src/panels/sources/body.ts +161 -0
- package/src/panels/sources/index.tsx +85 -0
- package/src/panels/sources/model.ts +94 -0
- package/src/panels/sources/sourcepath.tsx +28 -0
- package/src/panels/variables/grid.ts +144 -0
- package/src/panels/variables/gridpanel.ts +455 -0
- package/src/panels/variables/index.ts +199 -0
- package/src/panels/variables/mimerenderer.ts +125 -0
- package/src/panels/variables/model.ts +61 -0
- package/src/panels/variables/scope.tsx +132 -0
- package/src/panels/variables/tree.tsx +521 -0
- package/src/service.ts +1009 -0
- package/src/session.ts +342 -0
- package/src/sidebar.ts +194 -0
- package/src/sources.ts +327 -0
- package/src/svg.d.ts +9 -0
- package/src/tokens.ts +1071 -0
- package/style/base.css +2 -1
- package/style/breakpoints.css +21 -12
- package/style/icons/arrow-collapse.svg +1 -1
- package/style/icons/arrow-expand.svg +1 -1
- package/style/icons/exceptions.svg +10 -0
- package/style/icons/open-kernel-source.svg +6 -0
- package/style/icons/pause.svg +6 -0
- package/style/icons.css +9 -8
- package/style/index.css +1 -1
- package/style/index.js +1 -1
- package/style/kernelSources.css +45 -0
- package/style/sidebar.css +1 -1
- package/style/variables.css +82 -21
package/lib/sidebar.js.map
CHAN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C,CAAC,CAAC,EAAE;gBAC7B,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;YAC3C,CAAC,CAAC,CAAC;QACL,CAAC;KACF;IAVY,sBAAM,SAUlB,CAAA;AACH,CAAC,EAlDgB,eAAe,KAAf,eAAe,QAkD/B;AAED;;GAEG;AACH,IAAU,OAAO,CAYhB;AAZD,WAAU,OAAO;IACf;;OAEG;IACH,SAAgB,YAAY;QAC1B,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAE3C,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC;QACxB,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QAEzC,OAAO,KAAK,CAAC;IACf,CAAC;IAPe,oBAAY,eAO3B,CAAA;AACH,CAAC,EAZS,OAAO,KAAP,OAAO,QAYhB"}
|
package/lib/sources.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JupyterFrontEnd } from '@jupyterlab/application';
|
|
2
|
-
import {
|
|
2
|
+
import { IEditorServices } from '@jupyterlab/codeeditor';
|
|
3
3
|
import { IConsoleTracker } from '@jupyterlab/console';
|
|
4
4
|
import { IEditorTracker } from '@jupyterlab/fileeditor';
|
|
5
5
|
import { INotebookTracker } from '@jupyterlab/notebook';
|
|
@@ -21,7 +21,7 @@ export declare class DebuggerSources implements IDebugger.ISources {
|
|
|
21
21
|
*
|
|
22
22
|
* @param params - The editor search parameters.
|
|
23
23
|
*/
|
|
24
|
-
find(params: IDebugger.ISources.FindParams):
|
|
24
|
+
find(params: IDebugger.ISources.FindParams): IDebugger.ISources.IEditor[];
|
|
25
25
|
/**
|
|
26
26
|
* Open a read-only editor in the main area.
|
|
27
27
|
*
|
package/lib/sources.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
import { DOMUtils, MainAreaWidget, WidgetTracker } from '@jupyterlab/apputils';
|
|
4
4
|
import { textEditorIcon } from '@jupyterlab/ui-components';
|
|
5
|
-
import { each } from '@lumino/algorithm';
|
|
6
5
|
/**
|
|
7
6
|
* The source and editor manager for a debugger instance.
|
|
8
7
|
*/
|
|
@@ -51,7 +50,7 @@ export class DebuggerSources {
|
|
|
51
50
|
widget.title.closable = true;
|
|
52
51
|
widget.title.caption = caption;
|
|
53
52
|
widget.title.icon = textEditorIcon;
|
|
54
|
-
this._shell.add(widget, 'main');
|
|
53
|
+
this._shell.add(widget, 'main', { type: 'Debugger Sources' });
|
|
55
54
|
void this._readOnlyEditorTracker.add(widget);
|
|
56
55
|
}
|
|
57
56
|
/**
|
|
@@ -77,7 +76,7 @@ export class DebuggerSources {
|
|
|
77
76
|
const cells = notebookPanel.content.widgets;
|
|
78
77
|
cells.forEach((cell, i) => {
|
|
79
78
|
// check the event is for the correct cell
|
|
80
|
-
const code = cell.model.
|
|
79
|
+
const code = cell.model.sharedModel.getSource();
|
|
81
80
|
const codeId = this._getCodeId(code, kernel);
|
|
82
81
|
if (!codeId) {
|
|
83
82
|
return;
|
|
@@ -88,13 +87,17 @@ export class DebuggerSources {
|
|
|
88
87
|
if (focus) {
|
|
89
88
|
notebook.activeCellIndex = i;
|
|
90
89
|
if (notebook.activeCell) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
notebook.scrollToItem(notebook.activeCellIndex).catch(reason => {
|
|
91
|
+
// no-op
|
|
92
|
+
});
|
|
94
93
|
}
|
|
95
94
|
this._shell.activateById(notebookPanel.id);
|
|
96
95
|
}
|
|
97
|
-
editors.push(
|
|
96
|
+
editors.push(Object.freeze({
|
|
97
|
+
get: () => cell.editor,
|
|
98
|
+
reveal: () => notebook.scrollToItem(i),
|
|
99
|
+
src: cell.model.sharedModel
|
|
100
|
+
}));
|
|
98
101
|
});
|
|
99
102
|
});
|
|
100
103
|
return editors;
|
|
@@ -116,20 +119,24 @@ export class DebuggerSources {
|
|
|
116
119
|
return;
|
|
117
120
|
}
|
|
118
121
|
const cells = consoleWidget.console.cells;
|
|
119
|
-
|
|
120
|
-
const code = cell.model.
|
|
122
|
+
for (const cell of cells) {
|
|
123
|
+
const code = cell.model.sharedModel.getSource();
|
|
121
124
|
const codeId = this._getCodeId(code, kernel);
|
|
122
125
|
if (!codeId) {
|
|
123
|
-
|
|
126
|
+
break;
|
|
124
127
|
}
|
|
125
128
|
if (source !== codeId) {
|
|
126
|
-
|
|
129
|
+
break;
|
|
127
130
|
}
|
|
128
|
-
editors.push(
|
|
131
|
+
editors.push(Object.freeze({
|
|
132
|
+
get: () => cell.editor,
|
|
133
|
+
reveal: () => Promise.resolve(this._shell.activateById(consoleWidget.id)),
|
|
134
|
+
src: cell.model.sharedModel
|
|
135
|
+
}));
|
|
129
136
|
if (focus) {
|
|
130
137
|
this._shell.activateById(consoleWidget.id);
|
|
131
138
|
}
|
|
132
|
-
}
|
|
139
|
+
}
|
|
133
140
|
});
|
|
134
141
|
return editors;
|
|
135
142
|
}
|
|
@@ -153,7 +160,7 @@ export class DebuggerSources {
|
|
|
153
160
|
if (!editor) {
|
|
154
161
|
return;
|
|
155
162
|
}
|
|
156
|
-
const code = editor.model.
|
|
163
|
+
const code = editor.model.sharedModel.getSource();
|
|
157
164
|
const codeId = this._getCodeId(code, kernel);
|
|
158
165
|
if (!codeId) {
|
|
159
166
|
return;
|
|
@@ -161,7 +168,11 @@ export class DebuggerSources {
|
|
|
161
168
|
if (source !== codeId) {
|
|
162
169
|
return;
|
|
163
170
|
}
|
|
164
|
-
editors.push(
|
|
171
|
+
editors.push(Object.freeze({
|
|
172
|
+
get: () => editor,
|
|
173
|
+
reveal: () => Promise.resolve(this._shell.activateById(doc.id)),
|
|
174
|
+
src: fileEditor.model.sharedModel
|
|
175
|
+
}));
|
|
165
176
|
if (focus) {
|
|
166
177
|
this._shell.activateById(doc.id);
|
|
167
178
|
}
|
|
@@ -182,7 +193,7 @@ export class DebuggerSources {
|
|
|
182
193
|
if (!editor) {
|
|
183
194
|
return;
|
|
184
195
|
}
|
|
185
|
-
const code = editor.model.
|
|
196
|
+
const code = editor.model.sharedModel.getSource();
|
|
186
197
|
const codeId = this._getCodeId(code, kernel);
|
|
187
198
|
if (!codeId) {
|
|
188
199
|
return;
|
|
@@ -190,7 +201,11 @@ export class DebuggerSources {
|
|
|
190
201
|
if (widget.title.caption !== source && source !== codeId) {
|
|
191
202
|
return;
|
|
192
203
|
}
|
|
193
|
-
editors.push(
|
|
204
|
+
editors.push(Object.freeze({
|
|
205
|
+
get: () => editor,
|
|
206
|
+
reveal: () => Promise.resolve(this._shell.activateById(widget.id)),
|
|
207
|
+
src: editor.model.sharedModel
|
|
208
|
+
}));
|
|
194
209
|
if (focus) {
|
|
195
210
|
this._shell.activateById(widget.id);
|
|
196
211
|
}
|
package/lib/sources.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.js","sourceRoot":"","sources":["../src/sources.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;
|
|
1
|
+
{"version":3,"file":"sources.js","sourceRoot":"","sources":["../src/sources.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK/E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;GAEG;AACH,MAAM,OAAO,eAAe;IAC1B;;;;OAIG;IACH,YAAY,OAAiC;;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,gBAAgB,GAAG,MAAA,OAAO,CAAC,eAAe,mCAAI,IAAI,CAAC;QACxD,IAAI,CAAC,eAAe,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI,CAA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F,IAAI,KAAK,EAAE;gBACT,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aACrC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;OAMG;IACK,UAAU,CAAC,IAAY,EAAE,MAAc;QAC7C,IAAI;YACF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC7C;QAAC,WAAM;YACN,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CAWF"}
|
package/lib/tokens.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor';
|
|
2
2
|
import { KernelMessage, Session } from '@jupyterlab/services';
|
|
3
|
+
import { ISharedText } from '@jupyter/ydoc';
|
|
3
4
|
import { ReadonlyJSONObject, Token } from '@lumino/coreutils';
|
|
4
|
-
import { IObservableDisposable } from '@lumino/disposable';
|
|
5
|
+
import { IDisposable, IObservableDisposable } from '@lumino/disposable';
|
|
5
6
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
6
7
|
import { Panel } from '@lumino/widgets';
|
|
7
|
-
import { DebugProtocol } from 'vscode
|
|
8
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
8
9
|
import { DebuggerHandler } from './handler';
|
|
9
10
|
/**
|
|
10
11
|
* An interface describing an application's visual debugger.
|
|
@@ -18,6 +19,14 @@ export interface IDebugger {
|
|
|
18
19
|
* Whether the current debugger is started.
|
|
19
20
|
*/
|
|
20
21
|
readonly isStarted: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Get debugger config.
|
|
24
|
+
*/
|
|
25
|
+
readonly config: IDebugger.IConfig;
|
|
26
|
+
/**
|
|
27
|
+
* A signal emitted when the pause on exception filter changes.
|
|
28
|
+
*/
|
|
29
|
+
readonly pauseOnExceptionChanged: Signal<IDebugger, void>;
|
|
21
30
|
/**
|
|
22
31
|
* The debugger service's model.
|
|
23
32
|
*/
|
|
@@ -34,6 +43,20 @@ export interface IDebugger {
|
|
|
34
43
|
* Removes all the breakpoints from the current notebook or console
|
|
35
44
|
*/
|
|
36
45
|
clearBreakpoints(): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Used to determine if kernel has pause on exception capabilities
|
|
48
|
+
*/
|
|
49
|
+
pauseOnExceptionsIsValid(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Add a filter to pauseOnExceptionsFilter.
|
|
52
|
+
*
|
|
53
|
+
* @param exceptionFilter - filter name.
|
|
54
|
+
*/
|
|
55
|
+
pauseOnExceptionsFilter(exceptionFilter: string): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Send the pauseOnExceptions' filters to the debugger.
|
|
58
|
+
*/
|
|
59
|
+
pauseOnExceptions(exceptionFilter: string[]): Promise<void>;
|
|
37
60
|
/**
|
|
38
61
|
* Continues the execution of the current thread.
|
|
39
62
|
*/
|
|
@@ -66,15 +89,19 @@ export interface IDebugger {
|
|
|
66
89
|
* Request rich representation of a variable.
|
|
67
90
|
*
|
|
68
91
|
* @param variableName The variable name to request
|
|
69
|
-
* @param
|
|
92
|
+
* @param frameId The current frame id in which to request the variable
|
|
70
93
|
* @returns The mime renderer data model
|
|
71
94
|
*/
|
|
72
|
-
inspectRichVariable(variableName: string,
|
|
95
|
+
inspectRichVariable(variableName: string, frameId?: number): Promise<IDebugger.IRichVariable>;
|
|
73
96
|
/**
|
|
74
97
|
* Requests all the defined variables and display them in the
|
|
75
98
|
* table view.
|
|
76
99
|
*/
|
|
77
100
|
displayDefinedVariables(): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Requests all the loaded modules and display them.
|
|
103
|
+
*/
|
|
104
|
+
displayModules(): Promise<void>;
|
|
78
105
|
/**
|
|
79
106
|
* Request whether debugging is available for the given session connection.
|
|
80
107
|
*
|
|
@@ -102,6 +129,10 @@ export interface IDebugger {
|
|
|
102
129
|
* Precondition: !isStarted
|
|
103
130
|
*/
|
|
104
131
|
start(): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Makes the current thread pause if possible.
|
|
134
|
+
*/
|
|
135
|
+
pause(): Promise<void>;
|
|
105
136
|
/**
|
|
106
137
|
* Makes the current thread step in a function / method if possible.
|
|
107
138
|
*/
|
|
@@ -158,6 +189,19 @@ export declare namespace IDebugger {
|
|
|
158
189
|
*/
|
|
159
190
|
path: string;
|
|
160
191
|
};
|
|
192
|
+
/**
|
|
193
|
+
* The type for a kernel source file.
|
|
194
|
+
*/
|
|
195
|
+
type KernelSource = {
|
|
196
|
+
/**
|
|
197
|
+
* The name of the source.
|
|
198
|
+
*/
|
|
199
|
+
name: string;
|
|
200
|
+
/**
|
|
201
|
+
* The path of the source.
|
|
202
|
+
*/
|
|
203
|
+
path: string;
|
|
204
|
+
};
|
|
161
205
|
/**
|
|
162
206
|
* Single breakpoint in an editor.
|
|
163
207
|
*/
|
|
@@ -230,13 +274,35 @@ export declare namespace IDebugger {
|
|
|
230
274
|
*/
|
|
231
275
|
connection: Session.ISessionConnection | null;
|
|
232
276
|
/**
|
|
233
|
-
*
|
|
277
|
+
* Returns the initialize response.
|
|
278
|
+
*/
|
|
279
|
+
readonly capabilities: DebugProtocol.Capabilities | undefined;
|
|
280
|
+
/**
|
|
281
|
+
* Whether the debug session is started.
|
|
234
282
|
*/
|
|
235
283
|
readonly isStarted: boolean;
|
|
284
|
+
/**
|
|
285
|
+
* Whether the debug session is pausing on exceptions.
|
|
286
|
+
*/
|
|
287
|
+
exceptionPaths: string[];
|
|
288
|
+
/**
|
|
289
|
+
* Get exception filters and default values.
|
|
290
|
+
*/
|
|
291
|
+
exceptionBreakpointFilters: DebugProtocol.ExceptionBreakpointsFilter[] | undefined;
|
|
236
292
|
/**
|
|
237
293
|
* Signal emitted for debug event messages.
|
|
238
294
|
*/
|
|
239
295
|
readonly eventMessage: ISignal<IDebugger.ISession, IDebugger.ISession.Event>;
|
|
296
|
+
/**
|
|
297
|
+
* Get current exception filter.
|
|
298
|
+
*/
|
|
299
|
+
currentExceptionFilters: string[];
|
|
300
|
+
/**
|
|
301
|
+
* Whether the debugger is pausing on exception.
|
|
302
|
+
*
|
|
303
|
+
* @param filter - Specify a filter
|
|
304
|
+
*/
|
|
305
|
+
isPausingOnException(filter?: string): boolean;
|
|
240
306
|
/**
|
|
241
307
|
* Restore the state of a debug session.
|
|
242
308
|
*/
|
|
@@ -265,7 +331,7 @@ export declare namespace IDebugger {
|
|
|
265
331
|
*
|
|
266
332
|
* @param params - The editor find parameters.
|
|
267
333
|
*/
|
|
268
|
-
find(params: ISources.FindParams):
|
|
334
|
+
find(params: ISources.FindParams): ISources.IEditor[];
|
|
269
335
|
/**
|
|
270
336
|
* Open a read-only editor in the main area.
|
|
271
337
|
*
|
|
@@ -452,9 +518,10 @@ export declare namespace IDebugger {
|
|
|
452
518
|
* Whether the kernel supports variable rich rendering or not.
|
|
453
519
|
*/
|
|
454
520
|
richRendering?: boolean;
|
|
455
|
-
stoppedThreads: number[];
|
|
456
521
|
tmpFilePrefix: string;
|
|
457
522
|
tmpFileSuffix: string;
|
|
523
|
+
stoppedThreads: number[];
|
|
524
|
+
exceptionPaths: string[];
|
|
458
525
|
};
|
|
459
526
|
}
|
|
460
527
|
/**
|
|
@@ -517,38 +584,49 @@ export declare namespace IDebugger {
|
|
|
517
584
|
interface IInfoReply extends KernelMessage.IInfoReply {
|
|
518
585
|
debugger: boolean;
|
|
519
586
|
}
|
|
587
|
+
/**
|
|
588
|
+
* An interface for current exception filters.
|
|
589
|
+
*/
|
|
590
|
+
interface IExceptionFilter {
|
|
591
|
+
[kernels: string]: string[];
|
|
592
|
+
}
|
|
520
593
|
}
|
|
521
594
|
/**
|
|
522
595
|
* Select variable in the variables explorer.
|
|
596
|
+
*
|
|
597
|
+
* @hidden
|
|
598
|
+
*
|
|
599
|
+
* #### Notes
|
|
600
|
+
* This is experimental API
|
|
523
601
|
*/
|
|
524
602
|
interface IVariableSelection extends Pick<DebugProtocol.Variable, 'name' | 'type' | 'variablesReference' | 'value'> {
|
|
525
603
|
}
|
|
526
|
-
/**
|
|
527
|
-
* Debugger variables explorer interface.
|
|
528
|
-
*/
|
|
529
|
-
interface IVariablesPanel {
|
|
530
|
-
/**
|
|
531
|
-
* Select variable in the variables explorer.
|
|
532
|
-
*/
|
|
533
|
-
latestSelection: IVariableSelection | null;
|
|
534
|
-
/**
|
|
535
|
-
* Variable view mode.
|
|
536
|
-
*/
|
|
537
|
-
viewMode: 'tree' | 'table';
|
|
538
|
-
}
|
|
539
604
|
/**
|
|
540
605
|
* Debugger sidebar interface.
|
|
541
606
|
*/
|
|
542
607
|
interface ISidebar extends Panel {
|
|
543
|
-
/**
|
|
544
|
-
* Debugger variables explorer.
|
|
545
|
-
*/
|
|
546
|
-
variables: IVariablesPanel;
|
|
547
608
|
}
|
|
548
609
|
/**
|
|
549
610
|
* A utility to find text editors used by the debugger.
|
|
550
611
|
*/
|
|
551
612
|
namespace ISources {
|
|
613
|
+
/**
|
|
614
|
+
* Source editor interface
|
|
615
|
+
*/
|
|
616
|
+
interface IEditor {
|
|
617
|
+
/**
|
|
618
|
+
* Editor getter
|
|
619
|
+
*/
|
|
620
|
+
get(): CodeEditor.IEditor | null;
|
|
621
|
+
/**
|
|
622
|
+
* Reveal editor
|
|
623
|
+
*/
|
|
624
|
+
reveal(): Promise<void>;
|
|
625
|
+
/**
|
|
626
|
+
* Editor source text
|
|
627
|
+
*/
|
|
628
|
+
src: ISharedText;
|
|
629
|
+
}
|
|
552
630
|
/**
|
|
553
631
|
* Unified parameters for the find method
|
|
554
632
|
*/
|
|
@@ -677,6 +755,10 @@ export declare namespace IDebugger {
|
|
|
677
755
|
* The sources UI model.
|
|
678
756
|
*/
|
|
679
757
|
readonly sources: ISources;
|
|
758
|
+
/**
|
|
759
|
+
* The kernel sources UI model.
|
|
760
|
+
*/
|
|
761
|
+
readonly kernelSources: IKernelSources;
|
|
680
762
|
/**
|
|
681
763
|
* The set of threads in stopped state.
|
|
682
764
|
*/
|
|
@@ -719,6 +801,35 @@ export declare namespace IDebugger {
|
|
|
719
801
|
*/
|
|
720
802
|
open(): void;
|
|
721
803
|
}
|
|
804
|
+
/**
|
|
805
|
+
* The kernel sources UI model.
|
|
806
|
+
*/
|
|
807
|
+
interface IKernelSources extends IDisposable {
|
|
808
|
+
/**
|
|
809
|
+
* The kernel source.
|
|
810
|
+
*/
|
|
811
|
+
kernelSources: IDebugger.KernelSource[] | null;
|
|
812
|
+
/**
|
|
813
|
+
* The filter to apply.
|
|
814
|
+
*/
|
|
815
|
+
filter: string;
|
|
816
|
+
/**
|
|
817
|
+
* Signal emitted when the kernel sources have changed.
|
|
818
|
+
*/
|
|
819
|
+
readonly changed: ISignal<IDebugger.Model.IKernelSources, IDebugger.KernelSource[] | null>;
|
|
820
|
+
/**
|
|
821
|
+
* Signal emitted when the kernel sources filter has changed.
|
|
822
|
+
*/
|
|
823
|
+
readonly filterChanged: ISignal<IDebugger.Model.IKernelSources, string>;
|
|
824
|
+
/**
|
|
825
|
+
* Signal emitted when a kernel source has be opened in the main area.
|
|
826
|
+
*/
|
|
827
|
+
readonly kernelSourceOpened: ISignal<IDebugger.Model.IKernelSources, IDebugger.Source | null>;
|
|
828
|
+
/**
|
|
829
|
+
* Open a source in the main area.
|
|
830
|
+
*/
|
|
831
|
+
open(source: IDebugger.Source): void;
|
|
832
|
+
}
|
|
722
833
|
/**
|
|
723
834
|
* The variables UI model.
|
|
724
835
|
*/
|
|
@@ -735,6 +846,10 @@ export declare namespace IDebugger {
|
|
|
735
846
|
* Signal emitted when the current variable has been expanded.
|
|
736
847
|
*/
|
|
737
848
|
readonly variableExpanded: ISignal<this, IDebugger.IVariable>;
|
|
849
|
+
/**
|
|
850
|
+
* Selected variable in the variables explorer.
|
|
851
|
+
*/
|
|
852
|
+
selectedVariable: IVariableSelection | null;
|
|
738
853
|
/**
|
|
739
854
|
* Expand a variable.
|
|
740
855
|
*
|
package/lib/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAQ3D,OAAO,EAAsB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAsgC9D;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,KAAK,CAAY,gCAAgC,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,KAAK,CACtC,sCAAsC,CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,uCAAuC,CACxC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,uCAAuC,CACxC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,uCAAuC,CACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/debugger",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.20",
|
|
4
4
|
"description": "JupyterLab - Debugger Extension",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -34,66 +34,58 @@
|
|
|
34
34
|
"schema/*.json",
|
|
35
35
|
"style/**/*.css",
|
|
36
36
|
"style/**/*.svg",
|
|
37
|
-
"style/index.js"
|
|
37
|
+
"style/index.js",
|
|
38
|
+
"src/**/*.{ts,tsx}"
|
|
38
39
|
],
|
|
39
40
|
"scripts": {
|
|
40
41
|
"build": "tsc -b",
|
|
41
42
|
"build:test": "tsc --build tsconfig.test.json",
|
|
42
43
|
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo && rimraf tsconfig.test.tsbuildinfo && rimraf tests/build",
|
|
43
44
|
"docs": "typedoc --options tdoptions.json --theme ../../typedoc-theme src",
|
|
44
|
-
"test": "jest",
|
|
45
|
-
"test:cov": "jest --collect-coverage",
|
|
45
|
+
"test": "jest -i",
|
|
46
|
+
"test:cov": "jest -i --collect-coverage",
|
|
46
47
|
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
|
47
48
|
"test:debug:watch": "node --inspect-brk node_modules/.bin/jest --runInBand --watch",
|
|
48
49
|
"watch": "tsc -b --watch"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@jupyterlab/
|
|
55
|
-
"@jupyterlab/
|
|
56
|
-
"@jupyterlab/
|
|
57
|
-
"@jupyterlab/
|
|
58
|
-
"@jupyterlab/
|
|
59
|
-
"@jupyterlab/
|
|
60
|
-
"@jupyterlab/
|
|
61
|
-
"@jupyterlab/
|
|
62
|
-
"@jupyterlab/
|
|
63
|
-
"@jupyterlab/
|
|
64
|
-
"@jupyterlab/
|
|
65
|
-
"@jupyterlab/
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
69
|
-
"@lumino/
|
|
70
|
-
"@lumino/
|
|
71
|
-
"@lumino/
|
|
72
|
-
"@lumino/
|
|
73
|
-
"@lumino/
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
52
|
+
"@codemirror/state": "^6.2.0",
|
|
53
|
+
"@codemirror/view": "^6.7.0",
|
|
54
|
+
"@jupyter/ydoc": "^0.3.1",
|
|
55
|
+
"@jupyterlab/application": "^4.0.0-alpha.20",
|
|
56
|
+
"@jupyterlab/apputils": "^4.0.0-alpha.20",
|
|
57
|
+
"@jupyterlab/cells": "^4.0.0-alpha.20",
|
|
58
|
+
"@jupyterlab/codeeditor": "^4.0.0-alpha.20",
|
|
59
|
+
"@jupyterlab/codemirror": "^4.0.0-alpha.20",
|
|
60
|
+
"@jupyterlab/console": "^4.0.0-alpha.20",
|
|
61
|
+
"@jupyterlab/coreutils": "^6.0.0-alpha.20",
|
|
62
|
+
"@jupyterlab/docregistry": "^4.0.0-alpha.20",
|
|
63
|
+
"@jupyterlab/fileeditor": "^4.0.0-alpha.20",
|
|
64
|
+
"@jupyterlab/notebook": "^4.0.0-alpha.20",
|
|
65
|
+
"@jupyterlab/observables": "^5.0.0-alpha.20",
|
|
66
|
+
"@jupyterlab/rendermime": "^4.0.0-alpha.20",
|
|
67
|
+
"@jupyterlab/services": "^7.0.0-alpha.20",
|
|
68
|
+
"@jupyterlab/translation": "^4.0.0-alpha.20",
|
|
69
|
+
"@jupyterlab/ui-components": "^4.0.0-alpha.35",
|
|
70
|
+
"@lumino/algorithm": "^2.0.0-rc.0",
|
|
71
|
+
"@lumino/commands": "^2.0.0-rc.0",
|
|
72
|
+
"@lumino/coreutils": "^2.0.0-rc.0",
|
|
73
|
+
"@lumino/datagrid": "^2.0.0-rc.0",
|
|
74
|
+
"@lumino/disposable": "^2.0.0-rc.0",
|
|
75
|
+
"@lumino/messaging": "^2.0.0-rc.0",
|
|
76
|
+
"@lumino/polling": "^2.0.0-rc.0",
|
|
77
|
+
"@lumino/signaling": "^2.0.0-rc.0",
|
|
78
|
+
"@lumino/widgets": "^2.0.0-rc.0",
|
|
79
|
+
"@vscode/debugprotocol": "^1.51.0",
|
|
80
|
+
"react": "^18.2.0"
|
|
77
81
|
},
|
|
78
82
|
"devDependencies": {
|
|
79
|
-
"@
|
|
80
|
-
"@
|
|
81
|
-
"
|
|
82
|
-
"@types/codemirror": "^0.0.109",
|
|
83
|
-
"@types/jest": "^26.0.10",
|
|
84
|
-
"@types/react-dom": "^17.0.0",
|
|
85
|
-
"@types/text-encoding": "^0.0.35",
|
|
86
|
-
"canvas": "^2.6.1",
|
|
87
|
-
"jest": "^26.4.2",
|
|
88
|
-
"jest-junit": "^11.1.0",
|
|
89
|
-
"jest-raw-loader": "^1.0.1",
|
|
90
|
-
"jest-summary-reporter": "^0.0.2",
|
|
83
|
+
"@jupyterlab/testing": "^4.0.0-alpha.20",
|
|
84
|
+
"@types/jest": "^29.2.0",
|
|
85
|
+
"canvas": "^2.9.1",
|
|
91
86
|
"rimraf": "~3.0.0",
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"ts-jest": "^26.3.0",
|
|
95
|
-
"typedoc": "~0.21.2",
|
|
96
|
-
"typescript": "~4.5.2"
|
|
87
|
+
"typedoc": "~0.23.25",
|
|
88
|
+
"typescript": "~5.0.0-beta"
|
|
97
89
|
},
|
|
98
90
|
"publishConfig": {
|
|
99
91
|
"access": "public"
|
package/src/config.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
|
|
4
|
+
import { murmur2 } from './hash';
|
|
5
|
+
|
|
6
|
+
import { IDebugger } from './tokens';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A class that holds debugger configuration for all kernels.
|
|
10
|
+
*/
|
|
11
|
+
export class DebuggerConfig implements IDebugger.IConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Returns an id based on the given code.
|
|
14
|
+
*
|
|
15
|
+
* @param code The source code.
|
|
16
|
+
* @param kernel The kernel name from current session.
|
|
17
|
+
*/
|
|
18
|
+
getCodeId(code: string, kernel: string): string {
|
|
19
|
+
const fileParams = this._fileParams.get(kernel);
|
|
20
|
+
|
|
21
|
+
if (!fileParams) {
|
|
22
|
+
throw new Error(`Kernel (${kernel}) has no tmp file params.`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const hash = this._hashMethods.get(kernel);
|
|
26
|
+
|
|
27
|
+
if (!hash) {
|
|
28
|
+
throw new Error(`Kernel (${kernel}) has no hashing params.`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const { prefix, suffix } = fileParams;
|
|
32
|
+
return `${prefix}${hash(code)}${suffix}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Sets the hash parameters for a kernel.
|
|
37
|
+
*
|
|
38
|
+
* @param params - Hashing parameters for a kernel.
|
|
39
|
+
*/
|
|
40
|
+
setHashParams(params: IDebugger.IConfig.HashParams): void {
|
|
41
|
+
const { kernel, method, seed } = params;
|
|
42
|
+
if (!kernel) {
|
|
43
|
+
throw new TypeError(`Kernel name is not defined.`);
|
|
44
|
+
}
|
|
45
|
+
switch (method) {
|
|
46
|
+
case 'Murmur2':
|
|
47
|
+
this._hashMethods.set(kernel, code => murmur2(code, seed).toString());
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
throw new Error(`Hash method (${method}) is not supported.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Sets the parameters used by the kernel to create temp files (e.g. cells).
|
|
56
|
+
*
|
|
57
|
+
* @param params - Temporary file prefix and suffix for a kernel.
|
|
58
|
+
*/
|
|
59
|
+
setTmpFileParams(params: IDebugger.IConfig.FileParams): void {
|
|
60
|
+
const { kernel, prefix, suffix } = params;
|
|
61
|
+
if (!kernel) {
|
|
62
|
+
throw new TypeError(`Kernel name is not defined.`);
|
|
63
|
+
}
|
|
64
|
+
this._fileParams.set(kernel, { kernel, prefix, suffix });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Gets the parameters used for the temp files (e.e. cells) for a kernel.
|
|
69
|
+
*
|
|
70
|
+
* @param kernel - The kernel name from current session.
|
|
71
|
+
*/
|
|
72
|
+
getTmpFileParams(kernel: string): IDebugger.IConfig.FileParams {
|
|
73
|
+
return this._fileParams.get(kernel)!;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private _fileParams = new Map<string, IDebugger.IConfig.FileParams>();
|
|
77
|
+
private _hashMethods = new Map<string, (code: string) => string>();
|
|
78
|
+
}
|