@jupyterlab/debugger 4.0.0-alpha.1 → 4.0.0-alpha.12
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 +2 -0
- package/lib/debugger.js +3 -1
- package/lib/debugger.js.map +1 -1
- package/lib/dialogs/evaluate.js +4 -0
- package/lib/dialogs/evaluate.js.map +1 -1
- package/lib/handler.js +20 -5
- package/lib/handler.js.map +1 -1
- package/lib/handlers/editor.d.ts +18 -6
- package/lib/handlers/editor.js +156 -75
- package/lib/handlers/editor.js.map +1 -1
- package/lib/handlers/file.d.ts +1 -0
- package/lib/handlers/file.js +6 -1
- package/lib/handlers/file.js.map +1 -1
- package/lib/handlers/notebook.js +12 -2
- package/lib/handlers/notebook.js.map +1 -1
- package/lib/icons.d.ts +2 -0
- package/lib/icons.js +10 -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/body.js.map +1 -1
- package/lib/panels/breakpoints/index.d.ts +18 -0
- package/lib/panels/breakpoints/index.js +7 -2
- package/lib/panels/breakpoints/index.js.map +1 -1
- package/lib/panels/breakpoints/model.js.map +1 -1
- package/lib/panels/callstack/body.js.map +1 -1
- package/lib/panels/callstack/index.js.map +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.map +1 -1
- package/lib/panels/sources/index.js.map +1 -1
- package/lib/panels/sources/sourcepath.js.map +1 -1
- package/lib/panels/variables/grid.d.ts +0 -4
- package/lib/panels/variables/grid.js +4 -16
- package/lib/panels/variables/grid.js.map +1 -1
- 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 +52 -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 +1 -5
- package/lib/panels/variables/tree.js +11 -10
- package/lib/panels/variables/tree.js.map +1 -1
- package/lib/service.d.ts +17 -1
- package/lib/service.js +100 -2
- package/lib/service.js.map +1 -1
- package/lib/session.d.ts +23 -1
- package/lib/session.js +40 -5
- 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.js +1 -1
- package/lib/sources.js.map +1 -1
- package/lib/tokens.d.ts +93 -22
- package/lib/tokens.js.map +1 -1
- package/package.json +29 -28
- 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/open-kernel-source.svg +6 -0
- package/style/icons/pause.svg +6 -0
- package/style/icons.css +9 -8
- package/style/kernelSources.css +45 -0
- package/style/sidebar.css +1 -1
- package/style/variables.css +17 -4
package/lib/debugger.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export declare namespace Debugger {
|
|
|
83
83
|
const renderMimeVariable = "debugger:render-mime-variable";
|
|
84
84
|
const evaluate = "debugger:evaluate";
|
|
85
85
|
const restartDebug = "debugger:restart-debug";
|
|
86
|
+
const pause = "debugger:pause";
|
|
86
87
|
}
|
|
87
88
|
/**
|
|
88
89
|
* The debugger user interface icons.
|
|
@@ -97,6 +98,7 @@ export declare namespace Debugger {
|
|
|
97
98
|
const terminateIcon: import("@jupyterlab/ui-components").LabIcon;
|
|
98
99
|
const variableIcon: import("@jupyterlab/ui-components").LabIcon;
|
|
99
100
|
const viewBreakpointIcon: import("@jupyterlab/ui-components").LabIcon;
|
|
101
|
+
const pauseOnExceptionsIcon: import("@jupyterlab/ui-components").LabIcon;
|
|
100
102
|
}
|
|
101
103
|
/**
|
|
102
104
|
* The debugger dialog helpers.
|
package/lib/debugger.js
CHANGED
|
@@ -6,7 +6,7 @@ import { DebuggerEvaluateDialog } from './dialogs/evaluate';
|
|
|
6
6
|
import { ReadOnlyEditorFactory as EditorFactory } from './factory';
|
|
7
7
|
import { DebuggerHandler } from './handler';
|
|
8
8
|
import { EditorHandler as DebuggerEditorHandler } from './handlers/editor';
|
|
9
|
-
import { closeAllIcon as closeAll, stepIntoIcon as stepInto, stepOutIcon as stepOut, stepOverIcon as stepOver, variableIcon as variable, viewBreakpointIcon as viewBreakpoint } from './icons';
|
|
9
|
+
import { closeAllIcon as closeAll, pauseOnExceptionsIcon as pauseOnExceptions, stepIntoIcon as stepInto, stepOutIcon as stepOut, stepOverIcon as stepOver, variableIcon as variable, viewBreakpointIcon as viewBreakpoint } from './icons';
|
|
10
10
|
import { DebuggerModel } from './model';
|
|
11
11
|
import { VariablesBodyGrid } from './panels/variables/grid';
|
|
12
12
|
import { VariableMimeRenderer } from './panels/variables/mimerenderer';
|
|
@@ -100,6 +100,7 @@ export var Debugger;
|
|
|
100
100
|
CommandIDs.renderMimeVariable = 'debugger:render-mime-variable';
|
|
101
101
|
CommandIDs.evaluate = 'debugger:evaluate';
|
|
102
102
|
CommandIDs.restartDebug = 'debugger:restart-debug';
|
|
103
|
+
CommandIDs.pause = 'debugger:pause';
|
|
103
104
|
})(CommandIDs = Debugger.CommandIDs || (Debugger.CommandIDs = {}));
|
|
104
105
|
/**
|
|
105
106
|
* The debugger user interface icons.
|
|
@@ -115,6 +116,7 @@ export var Debugger;
|
|
|
115
116
|
Icons.terminateIcon = stopIcon;
|
|
116
117
|
Icons.variableIcon = variable;
|
|
117
118
|
Icons.viewBreakpointIcon = viewBreakpoint;
|
|
119
|
+
Icons.pauseOnExceptionsIcon = pauseOnExceptions;
|
|
118
120
|
})(Icons = Debugger.Icons || (Debugger.Icons = {}));
|
|
119
121
|
/**
|
|
120
122
|
* The debugger dialog helpers.
|
package/lib/debugger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugger.js","sourceRoot":"","sources":["../src/debugger.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EACL,YAAY,IAAI,QAAQ,EACxB,YAAY,IAAI,QAAQ,EACxB,WAAW,IAAI,OAAO,EACtB,YAAY,IAAI,QAAQ,EACxB,YAAY,IAAI,QAAQ,EACxB,kBAAkB,IAAI,cAAc,EACrC,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,eAAe,EA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B,0BAAe,GAAG,2BAA2B,CAAC;QAE9C,6BAAkB,GAAG,+BAA+B,CAAC;QAErD,mBAAQ,GAAG,mBAAmB,CAAC;QAE/B,uBAAY,GAAG,wBAAwB,CAAC;QAExC,gBAAK,GAAG,gBAAgB,CAAC;IACxC,CAAC,EAtBgB,UAAU,GAAV,mBAAU,KAAV,mBAAU,QAsB1B;IAED;;OAEG;IACH,IAAiB,KAAK,CAWrB;IAXD,WAAiB,KAAK;QACP,kBAAY,GAAG,QAAQ,CAAC;QACxB,kBAAY,GAAG,QAAQ,CAAC;QACxB,kBAAY,GAAG,OAAO,CAAC;QACvB,kBAAY,GAAG,QAAQ,CAAC;QACxB,iBAAW,GAAG,OAAO,CAAC;QACtB,kBAAY,GAAG,QAAQ,CAAC;QACxB,mBAAa,GAAG,QAAQ,CAAC;QACzB,kBAAY,GAAG,QAAQ,CAAC;QACxB,wBAAkB,GAAG,cAAc,CAAC;QACpC,2BAAqB,GAAG,iBAAiB,CAAC;IACzD,CAAC,EAXgB,KAAK,GAAL,cAAK,KAAL,cAAK,QAWrB;IAED;;OAEG;IACH,IAAiB,OAAO,CAKvB;IALD,WAAiB,OAAO;QACtB;;WAEG;QACU,eAAO,GAAG,sBAAsB,CAAC,OAAO,CAAC;IACxD,CAAC,EALgB,OAAO,GAAP,gBAAO,KAAP,gBAAO,QAKvB;AACH,CAAC,EA5GgB,QAAQ,KAAR,QAAQ,QA4GxB"}
|
package/lib/dialogs/evaluate.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Jupyter Development Team.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
1
5
|
import { Dialog } from '@jupyterlab/apputils';
|
|
2
6
|
import { CodeCell, CodeCellModel } from '@jupyterlab/cells';
|
|
3
7
|
import { Widget } from '@lumino/widgets';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.js","sourceRoot":"","sources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AAU;YACV,KAAK;SACN,CAAC,CAAC,eAAe,EAAE,CAAC;QAErB,0DAA0D;QAC1D,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QAE3C,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;IACvC,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,GAAY;QAClC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;CAGF"}
|
package/lib/handler.js
CHANGED
|
@@ -155,7 +155,7 @@ export class DebuggerHandler {
|
|
|
155
155
|
* @param connection The session connection.
|
|
156
156
|
*/
|
|
157
157
|
async updateWidget(widget, connection) {
|
|
158
|
-
var _a, _b;
|
|
158
|
+
var _a, _b, _c, _d;
|
|
159
159
|
if (!this._service.model || !connection) {
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
@@ -238,10 +238,14 @@ export class DebuggerHandler {
|
|
|
238
238
|
await this._service.stop();
|
|
239
239
|
};
|
|
240
240
|
const startDebugger = async () => {
|
|
241
|
+
var _a, _b;
|
|
241
242
|
this._service.session.connection = connection;
|
|
242
243
|
this._previousConnection = connection;
|
|
243
244
|
await this._service.restoreState(true);
|
|
244
245
|
await this._service.displayDefinedVariables();
|
|
246
|
+
if ((_b = (_a = this._service.session) === null || _a === void 0 ? void 0 : _a.capabilities) === null || _b === void 0 ? void 0 : _b.supportsModulesRequest) {
|
|
247
|
+
await this._service.displayModules();
|
|
248
|
+
}
|
|
245
249
|
};
|
|
246
250
|
const toggleDebugging = async () => {
|
|
247
251
|
// bail if the widget doesn't have focus
|
|
@@ -261,6 +265,15 @@ export class DebuggerHandler {
|
|
|
261
265
|
}
|
|
262
266
|
};
|
|
263
267
|
addToolbarButton(false);
|
|
268
|
+
// listen to the disposed signals
|
|
269
|
+
widget.disposed.connect(async () => {
|
|
270
|
+
if (isDebuggerOn()) {
|
|
271
|
+
await stopDebugger();
|
|
272
|
+
}
|
|
273
|
+
removeHandlers();
|
|
274
|
+
delete this._iconButtons[widget.id];
|
|
275
|
+
delete this._contextKernelChangedHandlers[widget.id];
|
|
276
|
+
});
|
|
264
277
|
const debuggingEnabled = await this._service.isAvailable(connection);
|
|
265
278
|
if (!debuggingEnabled) {
|
|
266
279
|
removeHandlers();
|
|
@@ -272,27 +285,29 @@ export class DebuggerHandler {
|
|
|
272
285
|
this._service.session = new Debugger.Session({ connection });
|
|
273
286
|
}
|
|
274
287
|
else {
|
|
275
|
-
this._previousConnection = ((_a = this._service.session.connection) === null || _a === void 0 ? void 0 : _a.kernel)
|
|
288
|
+
this._previousConnection = ((_a = this._service.session.connection) === null || _a === void 0 ? void 0 : _a.kernel)
|
|
289
|
+
? this._service.session.connection
|
|
276
290
|
: null;
|
|
277
291
|
this._service.session.connection = connection;
|
|
278
292
|
}
|
|
279
293
|
await this._service.restoreState(false);
|
|
280
294
|
if (this._service.isStarted && !this._service.hasStoppedThreads()) {
|
|
281
295
|
await this._service.displayDefinedVariables();
|
|
296
|
+
if ((_c = (_b = this._service.session) === null || _b === void 0 ? void 0 : _b.capabilities) === null || _c === void 0 ? void 0 : _c.supportsModulesRequest) {
|
|
297
|
+
await this._service.displayModules();
|
|
298
|
+
}
|
|
282
299
|
}
|
|
283
300
|
updateIconButtonState(this._iconButtons[widget.id], this._service.isStarted, true);
|
|
284
301
|
// check the state of the debug session
|
|
285
302
|
if (!this._service.isStarted) {
|
|
286
303
|
removeHandlers();
|
|
287
|
-
this._service.session.connection = (
|
|
304
|
+
this._service.session.connection = (_d = this._previousConnection) !== null && _d !== void 0 ? _d : connection;
|
|
288
305
|
await this._service.restoreState(false);
|
|
289
306
|
return;
|
|
290
307
|
}
|
|
291
308
|
// if the debugger is started but there is no handler, create a new one
|
|
292
309
|
createHandler();
|
|
293
310
|
this._previousConnection = connection;
|
|
294
|
-
// listen to the disposed signals
|
|
295
|
-
widget.disposed.connect(removeHandlers);
|
|
296
311
|
}
|
|
297
312
|
}
|
|
298
313
|
//# sourceMappingURL=handler.js.map
|
package/lib/handler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAU3D,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAE9C;;;;;GAKG;AACH,SAAS,gBAAgB,CACvB,MAAkE,EAClE,OAAmB,EACnB,OAAiB,EACjB,OAAiB,EACjB,aAA0B,cAAc;IAExC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC;QAC7B,SAAS,EAAE,sBAAsB;QACjC,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC;QACpC,WAAW,EAAE,UAAU;QACvB,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC;QAC5C,eAAe,EAAE,KAAK,CAAC,EAAE,CACvB,4DAA4D,CAC7D;QACD,OAAO;QACP,OAAO;QACP,OAAO;KACR,CAAC,C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,CAAC,MAAM,CAAC,EAAE,CAAE,EAC7B,IAAI,CAAC,QAAQ,CAAC,SAAS,EACvB,IAAI,CACL,CAAC;QAEF,uCAAuC;QACvC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE;YAC5B,cAAc,EAAE,CAAC;YACjB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,GAAG,MAAA,IAAI,CAAC,mBAAmB,mCAAI,UAAU,CAAC;YAC1E,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YACxC,OAAO;SACR;QAED,uEAAuE;QACvE,aAAa,EAAE,CAAC;QAChB,IAAI,CAAC,mBAAmB,GAAG,UAAU,CAAC;IACxC,CAAC;CAgDF"}
|
package/lib/handlers/editor.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CodeEditor } from '@jupyterlab/codeeditor';
|
|
2
2
|
import { IDisposable } from '@lumino/disposable';
|
|
3
|
+
import { StateEffectType } from '@codemirror/state';
|
|
3
4
|
import { IDebugger } from '../tokens';
|
|
4
5
|
/**
|
|
5
6
|
* A handler for a CodeEditor.IEditor.
|
|
@@ -11,6 +12,10 @@ export declare class EditorHandler implements IDisposable {
|
|
|
11
12
|
* @param options The instantiation options for a EditorHandler.
|
|
12
13
|
*/
|
|
13
14
|
constructor(options: EditorHandler.IOptions);
|
|
15
|
+
/**
|
|
16
|
+
* The editor
|
|
17
|
+
*/
|
|
18
|
+
get editor(): CodeEditor.IEditor;
|
|
14
19
|
/**
|
|
15
20
|
* Whether the handler is disposed.
|
|
16
21
|
*/
|
|
@@ -19,6 +24,10 @@ export declare class EditorHandler implements IDisposable {
|
|
|
19
24
|
* Dispose the handler.
|
|
20
25
|
*/
|
|
21
26
|
dispose(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Refresh the breakpoints display
|
|
29
|
+
*/
|
|
30
|
+
refreshBreakpoints(): void;
|
|
22
31
|
/**
|
|
23
32
|
* Setup the editor.
|
|
24
33
|
*/
|
|
@@ -46,6 +55,7 @@ export declare class EditorHandler implements IDisposable {
|
|
|
46
55
|
* Retrieve the breakpoints from the editor.
|
|
47
56
|
*/
|
|
48
57
|
private _getBreakpointsFromEditor;
|
|
58
|
+
private _clearGutter;
|
|
49
59
|
/**
|
|
50
60
|
* Get the breakpoints for the editor using its content (code),
|
|
51
61
|
* or its path (if it exists).
|
|
@@ -56,6 +66,11 @@ export declare class EditorHandler implements IDisposable {
|
|
|
56
66
|
private _editor;
|
|
57
67
|
private _debuggerService;
|
|
58
68
|
private _editorMonitor;
|
|
69
|
+
private _breakpointEffect;
|
|
70
|
+
private _breakpointState;
|
|
71
|
+
private _gutter;
|
|
72
|
+
private _highlightDeco;
|
|
73
|
+
private _highlightState;
|
|
59
74
|
}
|
|
60
75
|
/**
|
|
61
76
|
* A namespace for EditorHandler `statics`.
|
|
@@ -78,6 +93,9 @@ export declare namespace EditorHandler {
|
|
|
78
93
|
*/
|
|
79
94
|
path?: string;
|
|
80
95
|
}
|
|
96
|
+
const _highlightEffect: StateEffectType<{
|
|
97
|
+
pos: number[];
|
|
98
|
+
}>;
|
|
81
99
|
/**
|
|
82
100
|
* Highlight the current line of the frame in the given editor.
|
|
83
101
|
*
|
|
@@ -91,10 +109,4 @@ export declare namespace EditorHandler {
|
|
|
91
109
|
* @param editor The editor to cleanup.
|
|
92
110
|
*/
|
|
93
111
|
function clearHighlight(editor: CodeEditor.IEditor): void;
|
|
94
|
-
/**
|
|
95
|
-
* Remove line numbers and all gutters from editor.
|
|
96
|
-
*
|
|
97
|
-
* @param editor The editor to cleanup.
|
|
98
|
-
*/
|
|
99
|
-
function clearGutter(editor: CodeEditor.IEditor): void;
|
|
100
112
|
}
|
package/lib/handlers/editor.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
import { ActivityMonitor } from '@jupyterlab/coreutils';
|
|
4
4
|
import { Signal } from '@lumino/signaling';
|
|
5
|
+
import { Compartment, Prec, RangeSet, StateEffect, StateField } from '@codemirror/state';
|
|
6
|
+
import { Decoration, EditorView, gutter, GutterMarker } from '@codemirror/view';
|
|
5
7
|
/**
|
|
6
8
|
* The class name added to the current line.
|
|
7
9
|
*/
|
|
@@ -21,28 +23,6 @@ export class EditorHandler {
|
|
|
21
23
|
*/
|
|
22
24
|
constructor(options) {
|
|
23
25
|
var _a, _b, _c, _d;
|
|
24
|
-
/**
|
|
25
|
-
* Handle a click on the gutter.
|
|
26
|
-
*
|
|
27
|
-
* @param editor The editor from where the click originated.
|
|
28
|
-
* @param lineNumber The line corresponding to the click event.
|
|
29
|
-
*/
|
|
30
|
-
this._onGutterClick = (editor, lineNumber) => {
|
|
31
|
-
var _a, _b, _c;
|
|
32
|
-
const info = editor.lineInfo(lineNumber);
|
|
33
|
-
if (!info || this._id !== ((_b = (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.id)) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const remove = !!info.gutterMarkers;
|
|
37
|
-
let breakpoints = this._getBreakpoints();
|
|
38
|
-
if (remove) {
|
|
39
|
-
breakpoints = breakpoints.filter(ele => ele.line !== info.line + 1);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
breakpoints.push(Private.createBreakpoint((_c = this._path) !== null && _c !== void 0 ? _c : this._debuggerService.session.connection.name, info.line + 1));
|
|
43
|
-
}
|
|
44
|
-
void this._debuggerService.updateBreakpoints(this._editor.model.value.text, breakpoints, this._path);
|
|
45
|
-
};
|
|
46
26
|
this._id = (_c = (_b = (_a = options.debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : '';
|
|
47
27
|
this._path = (_d = options.path) !== null && _d !== void 0 ? _d : '';
|
|
48
28
|
this._debuggerService = options.debuggerService;
|
|
@@ -69,8 +49,65 @@ export class EditorHandler {
|
|
|
69
49
|
this._debuggerService.model.callstack.currentFrameChanged.connect(() => {
|
|
70
50
|
EditorHandler.clearHighlight(this._editor);
|
|
71
51
|
});
|
|
52
|
+
this._breakpointEffect = StateEffect.define({
|
|
53
|
+
map: (value, mapping) => ({ pos: value.pos.map(v => mapping.mapPos(v)) })
|
|
54
|
+
});
|
|
55
|
+
this._breakpointState = StateField.define({
|
|
56
|
+
create: () => {
|
|
57
|
+
return RangeSet.empty;
|
|
58
|
+
},
|
|
59
|
+
update: (breakpoints, transaction) => {
|
|
60
|
+
breakpoints = breakpoints.map(transaction.changes);
|
|
61
|
+
for (let ef of transaction.effects) {
|
|
62
|
+
if (ef.is(this._breakpointEffect)) {
|
|
63
|
+
let e = ef;
|
|
64
|
+
if (e.value.pos.length) {
|
|
65
|
+
breakpoints = breakpoints.update({
|
|
66
|
+
add: e.value.pos.map(v => Private.breakpointMarker.range(v)),
|
|
67
|
+
sort: true
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
breakpoints = RangeSet.empty;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return breakpoints;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
this._gutter = new Compartment();
|
|
79
|
+
this._highlightDeco = Decoration.line({ class: LINE_HIGHLIGHT_CLASS });
|
|
80
|
+
this._highlightState = StateField.define({
|
|
81
|
+
create: () => {
|
|
82
|
+
return Decoration.none;
|
|
83
|
+
},
|
|
84
|
+
update: (highlights, transaction) => {
|
|
85
|
+
highlights = highlights.map(transaction.changes);
|
|
86
|
+
for (let ef of transaction.effects) {
|
|
87
|
+
if (ef.is(EditorHandler._highlightEffect)) {
|
|
88
|
+
let e = ef;
|
|
89
|
+
if (e.value.pos.length) {
|
|
90
|
+
highlights = highlights.update({
|
|
91
|
+
add: e.value.pos.map(v => this._highlightDeco.range(v))
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
highlights = Decoration.none;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return highlights;
|
|
100
|
+
},
|
|
101
|
+
provide: f => EditorView.decorations.from(f)
|
|
102
|
+
});
|
|
72
103
|
this._setupEditor();
|
|
73
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* The editor
|
|
107
|
+
*/
|
|
108
|
+
get editor() {
|
|
109
|
+
return this._editor;
|
|
110
|
+
}
|
|
74
111
|
/**
|
|
75
112
|
* Dispose the handler.
|
|
76
113
|
*/
|
|
@@ -83,6 +120,12 @@ export class EditorHandler {
|
|
|
83
120
|
this.isDisposed = true;
|
|
84
121
|
Signal.clearData(this);
|
|
85
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Refresh the breakpoints display
|
|
125
|
+
*/
|
|
126
|
+
refreshBreakpoints() {
|
|
127
|
+
this._addBreakpointsToEditor();
|
|
128
|
+
}
|
|
86
129
|
/**
|
|
87
130
|
* Setup the editor.
|
|
88
131
|
*/
|
|
@@ -90,14 +133,26 @@ export class EditorHandler {
|
|
|
90
133
|
if (!this._editor || this._editor.isDisposed) {
|
|
91
134
|
return;
|
|
92
135
|
}
|
|
93
|
-
this._addBreakpointsToEditor();
|
|
94
136
|
const editor = this._editor;
|
|
95
137
|
editor.setOption('lineNumbers', true);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
138
|
+
const breakpointGutter = [
|
|
139
|
+
this._breakpointState,
|
|
140
|
+
this._highlightState,
|
|
141
|
+
Prec.highest(gutter({
|
|
142
|
+
class: 'cm-breakpoint-gutter',
|
|
143
|
+
renderEmptyElements: true,
|
|
144
|
+
markers: v => v.state.field(this._breakpointState),
|
|
145
|
+
initialSpacer: () => Private.breakpointMarker,
|
|
146
|
+
domEventHandlers: {
|
|
147
|
+
mousedown: (view, line) => {
|
|
148
|
+
this._onGutterClick(view, line.from);
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}))
|
|
153
|
+
];
|
|
154
|
+
editor.injectExtension(this._gutter.of(breakpointGutter));
|
|
155
|
+
this._addBreakpointsToEditor();
|
|
101
156
|
}
|
|
102
157
|
/**
|
|
103
158
|
* Clear the editor by removing visual elements and handlers.
|
|
@@ -108,10 +163,11 @@ export class EditorHandler {
|
|
|
108
163
|
}
|
|
109
164
|
const editor = this._editor;
|
|
110
165
|
EditorHandler.clearHighlight(editor);
|
|
111
|
-
|
|
166
|
+
this._clearGutter(editor);
|
|
112
167
|
editor.setOption('lineNumbers', false);
|
|
113
|
-
editor.editor.
|
|
114
|
-
|
|
168
|
+
editor.editor.dispatch({
|
|
169
|
+
effects: this._gutter.reconfigure([])
|
|
170
|
+
});
|
|
115
171
|
}
|
|
116
172
|
/**
|
|
117
173
|
* Send the breakpoints from the editor UI via the debug service.
|
|
@@ -120,9 +176,38 @@ export class EditorHandler {
|
|
|
120
176
|
if (this._editor.isDisposed) {
|
|
121
177
|
return;
|
|
122
178
|
}
|
|
123
|
-
const breakpoints = this._getBreakpointsFromEditor().map(
|
|
179
|
+
const breakpoints = this._getBreakpointsFromEditor().map(lineNumber => {
|
|
124
180
|
var _a, _b;
|
|
125
|
-
return Private.createBreakpoint(((_b = (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.name) || '',
|
|
181
|
+
return Private.createBreakpoint(((_b = (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.name) || '', lineNumber);
|
|
182
|
+
});
|
|
183
|
+
void this._debuggerService.updateBreakpoints(this._editor.model.value.text, breakpoints, this._path);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Handle a click on the gutter.
|
|
187
|
+
*
|
|
188
|
+
* @param editor The editor from where the click originated.
|
|
189
|
+
* @param lineNumber The line corresponding to the click event.
|
|
190
|
+
*/
|
|
191
|
+
_onGutterClick(editor, pos) {
|
|
192
|
+
var _a, _b, _c;
|
|
193
|
+
if (this._id !== ((_b = (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.id)) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const lineNumber = editor.state.doc.lineAt(pos).number;
|
|
197
|
+
let stateBreakpoints = editor.state.field(this._breakpointState);
|
|
198
|
+
let hasBreakpoint = false;
|
|
199
|
+
stateBreakpoints.between(pos, pos, () => {
|
|
200
|
+
hasBreakpoint = true;
|
|
201
|
+
});
|
|
202
|
+
let breakpoints = this._getBreakpoints();
|
|
203
|
+
if (hasBreakpoint) {
|
|
204
|
+
breakpoints = breakpoints.filter(ele => ele.line !== lineNumber);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
breakpoints.push(Private.createBreakpoint((_c = this._path) !== null && _c !== void 0 ? _c : this._debuggerService.session.connection.name, lineNumber));
|
|
208
|
+
}
|
|
209
|
+
breakpoints.sort((a, b) => {
|
|
210
|
+
return a.line - b.line;
|
|
126
211
|
});
|
|
127
212
|
void this._debuggerService.updateBreakpoints(this._editor.model.value.text, breakpoints, this._path);
|
|
128
213
|
}
|
|
@@ -131,16 +216,17 @@ export class EditorHandler {
|
|
|
131
216
|
*/
|
|
132
217
|
_addBreakpointsToEditor() {
|
|
133
218
|
var _a, _b;
|
|
134
|
-
const editor = this._editor;
|
|
135
|
-
const breakpoints = this._getBreakpoints();
|
|
136
219
|
if (this._id !== ((_b = (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.id)) {
|
|
137
220
|
return;
|
|
138
221
|
}
|
|
139
|
-
|
|
140
|
-
breakpoints.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
222
|
+
const editor = this._editor;
|
|
223
|
+
const breakpoints = this._getBreakpoints();
|
|
224
|
+
this._clearGutter(editor);
|
|
225
|
+
const breakpointPos = breakpoints.map(b => {
|
|
226
|
+
return editor.state.doc.line(b.line).from;
|
|
227
|
+
});
|
|
228
|
+
editor.editor.dispatch({
|
|
229
|
+
effects: this._breakpointEffect.of({ pos: breakpointPos })
|
|
144
230
|
});
|
|
145
231
|
}
|
|
146
232
|
/**
|
|
@@ -148,21 +234,29 @@ export class EditorHandler {
|
|
|
148
234
|
*/
|
|
149
235
|
_getBreakpointsFromEditor() {
|
|
150
236
|
const editor = this._editor;
|
|
237
|
+
const breakpoints = editor.editor.state.field(this._breakpointState);
|
|
151
238
|
let lines = [];
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
lines.push(info);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
239
|
+
breakpoints.between(0, editor.doc.length, (from) => {
|
|
240
|
+
lines.push(editor.doc.lineAt(from).number);
|
|
241
|
+
});
|
|
158
242
|
return lines;
|
|
159
243
|
}
|
|
244
|
+
_clearGutter(editor) {
|
|
245
|
+
if (!editor) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const view = editor.editor;
|
|
249
|
+
view.dispatch({
|
|
250
|
+
effects: this._breakpointEffect.of({ pos: [] })
|
|
251
|
+
});
|
|
252
|
+
}
|
|
160
253
|
/**
|
|
161
254
|
* Get the breakpoints for the editor using its content (code),
|
|
162
255
|
* or its path (if it exists).
|
|
163
256
|
*/
|
|
164
257
|
_getBreakpoints() {
|
|
165
|
-
const
|
|
258
|
+
const editor = this._editor;
|
|
259
|
+
const code = editor.doc.toString();
|
|
166
260
|
return this._debuggerService.model.breakpoints.getBreakpoints(this._path || this._debuggerService.getCodeId(code));
|
|
167
261
|
}
|
|
168
262
|
}
|
|
@@ -170,6 +264,9 @@ export class EditorHandler {
|
|
|
170
264
|
* A namespace for EditorHandler `statics`.
|
|
171
265
|
*/
|
|
172
266
|
(function (EditorHandler) {
|
|
267
|
+
EditorHandler._highlightEffect = StateEffect.define({
|
|
268
|
+
map: (value, mapping) => ({ pos: value.pos.map(v => mapping.mapPos(v)) })
|
|
269
|
+
});
|
|
173
270
|
/**
|
|
174
271
|
* Highlight the current line of the frame in the given editor.
|
|
175
272
|
*
|
|
@@ -179,8 +276,10 @@ export class EditorHandler {
|
|
|
179
276
|
function showCurrentLine(editor, line) {
|
|
180
277
|
clearHighlight(editor);
|
|
181
278
|
const cmEditor = editor;
|
|
182
|
-
cmEditor.
|
|
183
|
-
cmEditor.
|
|
279
|
+
const linePos = cmEditor.doc.line(line).from;
|
|
280
|
+
cmEditor.editor.dispatch({
|
|
281
|
+
effects: EditorHandler._highlightEffect.of({ pos: [linePos] })
|
|
282
|
+
});
|
|
184
283
|
}
|
|
185
284
|
EditorHandler.showCurrentLine = showCurrentLine;
|
|
186
285
|
/**
|
|
@@ -193,28 +292,11 @@ export class EditorHandler {
|
|
|
193
292
|
return;
|
|
194
293
|
}
|
|
195
294
|
const cmEditor = editor;
|
|
196
|
-
cmEditor.
|
|
197
|
-
|
|
295
|
+
cmEditor.editor.dispatch({
|
|
296
|
+
effects: EditorHandler._highlightEffect.of({ pos: [] })
|
|
198
297
|
});
|
|
199
298
|
}
|
|
200
299
|
EditorHandler.clearHighlight = clearHighlight;
|
|
201
|
-
/**
|
|
202
|
-
* Remove line numbers and all gutters from editor.
|
|
203
|
-
*
|
|
204
|
-
* @param editor The editor to cleanup.
|
|
205
|
-
*/
|
|
206
|
-
function clearGutter(editor) {
|
|
207
|
-
if (!editor) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
const cmEditor = editor;
|
|
211
|
-
cmEditor.doc.eachLine(line => {
|
|
212
|
-
if (line.gutterMarkers) {
|
|
213
|
-
cmEditor.editor.setGutterMarker(line, 'breakpoints', null);
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
EditorHandler.clearGutter = clearGutter;
|
|
218
300
|
})(EditorHandler || (EditorHandler = {}));
|
|
219
301
|
/**
|
|
220
302
|
* A namespace for module private data.
|
|
@@ -224,13 +306,12 @@ var Private;
|
|
|
224
306
|
/**
|
|
225
307
|
* Create a marker DOM element for a breakpoint.
|
|
226
308
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
Private.createMarkerNode = createMarkerNode;
|
|
309
|
+
Private.breakpointMarker = new (class extends GutterMarker {
|
|
310
|
+
toDOM() {
|
|
311
|
+
const marker = document.createTextNode('●');
|
|
312
|
+
return marker;
|
|
313
|
+
}
|
|
314
|
+
})();
|
|
234
315
|
/**
|
|
235
316
|
* Create a new breakpoint.
|
|
236
317
|
*
|