@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/icons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;AACtE,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,QAAQ,IAAI,aAAa,EAC1B,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC;IACtC,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC;IACvC,IAAI,EAAE,6BAA6B;IACnC,MAAM,EAAE,eAAe;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC;IACnC,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE,WAAW;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC;IACtC,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC;IACtC,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC;IACrC,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,aAAa;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC;IACtC,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,OAAO,CAAC;IAC5C,IAAI,EAAE,0BAA0B;IAChC,MAAM,EAAE,oBAAoB;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,OAAO,CAAC;IAC9C,IAAI,EAAE,6BAA6B;IACnC,MAAM,EAAE,sBAAsB;CAC/B,CAAC,CAAC"}
|
package/lib/model.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ISignal } from '@lumino/signaling';
|
|
|
3
3
|
import { BreakpointsModel } from './panels/breakpoints/model';
|
|
4
4
|
import { CallstackModel } from './panels/callstack/model';
|
|
5
5
|
import { SourcesModel } from './panels/sources/model';
|
|
6
|
+
import { KernelSourcesModel } from './panels/kernelSources/model';
|
|
6
7
|
import { VariablesModel } from './panels/variables/model';
|
|
7
8
|
/**
|
|
8
9
|
* A model for a debugger.
|
|
@@ -28,6 +29,10 @@ export declare class DebuggerModel implements IDebugger.Model.IService {
|
|
|
28
29
|
* The sources model.
|
|
29
30
|
*/
|
|
30
31
|
readonly sources: SourcesModel;
|
|
32
|
+
/**
|
|
33
|
+
* The sources model.
|
|
34
|
+
*/
|
|
35
|
+
readonly kernelSources: KernelSourcesModel;
|
|
31
36
|
/**
|
|
32
37
|
* A signal emitted when the debugger widget is disposed.
|
|
33
38
|
*/
|
package/lib/model.js
CHANGED
|
@@ -4,6 +4,7 @@ import { Signal } from '@lumino/signaling';
|
|
|
4
4
|
import { BreakpointsModel } from './panels/breakpoints/model';
|
|
5
5
|
import { CallstackModel } from './panels/callstack/model';
|
|
6
6
|
import { SourcesModel } from './panels/sources/model';
|
|
7
|
+
import { KernelSourcesModel } from './panels/kernelSources/model';
|
|
7
8
|
import { VariablesModel } from './panels/variables/model';
|
|
8
9
|
/**
|
|
9
10
|
* A model for a debugger.
|
|
@@ -25,6 +26,7 @@ export class DebuggerModel {
|
|
|
25
26
|
this.sources = new SourcesModel({
|
|
26
27
|
currentFrameChanged: this.callstack.currentFrameChanged
|
|
27
28
|
});
|
|
29
|
+
this.kernelSources = new KernelSourcesModel();
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* A signal emitted when the debugger widget is disposed.
|
|
@@ -89,6 +91,7 @@ export class DebuggerModel {
|
|
|
89
91
|
return;
|
|
90
92
|
}
|
|
91
93
|
this._isDisposed = true;
|
|
94
|
+
this.kernelSources.dispose();
|
|
92
95
|
this._disposed.emit();
|
|
93
96
|
}
|
|
94
97
|
/**
|
|
@@ -101,6 +104,7 @@ export class DebuggerModel {
|
|
|
101
104
|
this.callstack.frames = [];
|
|
102
105
|
this.variables.scopes = [];
|
|
103
106
|
this.sources.currentSource = null;
|
|
107
|
+
this.kernelSources.kernelSources = null;
|
|
104
108
|
this.title = '-';
|
|
105
109
|
}
|
|
106
110
|
}
|
package/lib/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAI3D,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB;;OAEG;IACH;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAI3D,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB;;OAEG;IACH;QA4HQ,cAAS,GAAG,IAAI,MAAM,CAAa,IAAI,CAAC,CAAC;QACzC,gBAAW,GAAG,KAAK,CAAC;QACpB,8BAAyB,GAAG,KAAK,CAAC;QAClC,oBAAe,GAAG,IAAI,GAAG,EAAU,CAAC;QACpC,WAAM,GAAG,GAAG,CAAC;QACb,kBAAa,GAAG,IAAI,MAAM,CAAe,IAAI,CAAC,CAAC;QAhIrD,IAAI,CAAC,WAAW,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAC1C,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC;QACtC,IAAI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C,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,WAAW,GAAG,IAAI,GAAG,EAAmC,CAAC;QAC/D,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;QAClC,IAAI,CAAC,aAAa,CAAC,aAAa,GAAG,IAAI,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;IACnB,CAAC;CAQF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ITranslator } from '@jupyterlab/translation';
|
|
2
2
|
import { PanelWithToolbar } from '@jupyterlab/ui-components';
|
|
3
|
+
import { CommandRegistry } from '@lumino/commands';
|
|
3
4
|
import { Signal } from '@lumino/signaling';
|
|
4
5
|
import { Panel } from '@lumino/widgets';
|
|
5
6
|
import { IDebugger } from '../../tokens';
|
|
@@ -19,6 +20,19 @@ export declare class Breakpoints extends PanelWithToolbar {
|
|
|
19
20
|
* A namespace for Breakpoints `statics`.
|
|
20
21
|
*/
|
|
21
22
|
export declare namespace Breakpoints {
|
|
23
|
+
/**
|
|
24
|
+
* The toolbar commands and registry for the breakpoints.
|
|
25
|
+
*/
|
|
26
|
+
interface ICommands {
|
|
27
|
+
/**
|
|
28
|
+
* The command registry.
|
|
29
|
+
*/
|
|
30
|
+
registry: CommandRegistry;
|
|
31
|
+
/**
|
|
32
|
+
* The pause on exceptions command ID.
|
|
33
|
+
*/
|
|
34
|
+
pauseOnExceptions: string;
|
|
35
|
+
}
|
|
22
36
|
/**
|
|
23
37
|
* Instantiation options for `Breakpoints`.
|
|
24
38
|
*/
|
|
@@ -31,6 +45,10 @@ export declare namespace Breakpoints {
|
|
|
31
45
|
* The debugger service.
|
|
32
46
|
*/
|
|
33
47
|
service: IDebugger;
|
|
48
|
+
/**
|
|
49
|
+
* The toolbar commands interface for the callstack.
|
|
50
|
+
*/
|
|
51
|
+
commands: ICommands;
|
|
34
52
|
/**
|
|
35
53
|
* The application language translator..
|
|
36
54
|
*/
|
|
@@ -4,8 +4,9 @@ import { Dialog, showDialog } from '@jupyterlab/apputils';
|
|
|
4
4
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
5
5
|
import { PanelWithToolbar, ToolbarButton } from '@jupyterlab/ui-components';
|
|
6
6
|
import { Signal } from '@lumino/signaling';
|
|
7
|
-
import { closeAllIcon } from '../../icons';
|
|
7
|
+
import { closeAllIcon, exceptionIcon } from '../../icons';
|
|
8
8
|
import { BreakpointsBody } from './body';
|
|
9
|
+
import { PauseOnExceptionsWidget } from './pauseonexceptions';
|
|
9
10
|
/**
|
|
10
11
|
* A Panel to show a list of breakpoints.
|
|
11
12
|
*/
|
|
@@ -19,10 +20,16 @@ export class Breakpoints extends PanelWithToolbar {
|
|
|
19
20
|
var _a;
|
|
20
21
|
super(options);
|
|
21
22
|
this.clicked = new Signal(this);
|
|
22
|
-
const { model, service } = options;
|
|
23
|
+
const { model, service, commands } = options;
|
|
23
24
|
const trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : nullTranslator).load('jupyterlab');
|
|
24
25
|
this.title.label = trans.__('Breakpoints');
|
|
25
26
|
const body = new BreakpointsBody(model);
|
|
27
|
+
this.toolbar.addItem('pauseOnException', new PauseOnExceptionsWidget({
|
|
28
|
+
service: service,
|
|
29
|
+
commands: commands,
|
|
30
|
+
icon: exceptionIcon,
|
|
31
|
+
tooltip: trans.__('Pause on exception filter')
|
|
32
|
+
}));
|
|
26
33
|
this.toolbar.addItem('closeAll', new ToolbarButton({
|
|
27
34
|
icon: closeAllIcon,
|
|
28
35
|
onClick: async () => {
|
|
@@ -34,7 +41,7 @@ export class Breakpoints extends PanelWithToolbar {
|
|
|
34
41
|
body: trans.__('Are you sure you want to remove all breakpoints?'),
|
|
35
42
|
buttons: [
|
|
36
43
|
Dialog.okButton({ label: trans.__('Remove breakpoints') }),
|
|
37
|
-
Dialog.cancelButton(
|
|
44
|
+
Dialog.cancelButton()
|
|
38
45
|
],
|
|
39
46
|
hasClose: true
|
|
40
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panels/breakpoints/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panels/breakpoints/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,gBAAgB;IAC/C;;;;OAIG;IACH,Y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,CAAC,CAAC;gBACH,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;oBACxB,OAAO,OAAO,CAAC,gBAAgB,EAAE,CAAC;iBACnC;YACH,CAAC;YACD,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAC;SAC5C,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;IAC1C,CAAC;CAGF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { MenuSvg, ToolbarButton, ToolbarButtonComponent } from '@jupyterlab/ui-components';
|
|
2
|
+
import { IDebugger } from '../../tokens';
|
|
3
|
+
import { Breakpoints } from './index';
|
|
4
|
+
/**
|
|
5
|
+
* A button which display a menu on click, to select the filter.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PauseOnExceptionsWidget extends ToolbarButton {
|
|
8
|
+
/**
|
|
9
|
+
* Constructor of the button.
|
|
10
|
+
*/
|
|
11
|
+
constructor(props: PauseOnExceptions.IProps);
|
|
12
|
+
/**
|
|
13
|
+
* Called when the debugger is initialized or the filter changed.
|
|
14
|
+
*/
|
|
15
|
+
onChange(): void;
|
|
16
|
+
/**
|
|
17
|
+
* open menu on click.
|
|
18
|
+
*/
|
|
19
|
+
onclick: () => void;
|
|
20
|
+
render(): JSX.Element;
|
|
21
|
+
private _menu;
|
|
22
|
+
private _props;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A menu with all the available filter from the debugger as entries.
|
|
26
|
+
*/
|
|
27
|
+
export declare class PauseOnExceptionsMenu extends MenuSvg {
|
|
28
|
+
/**
|
|
29
|
+
* The constructor of the menu.
|
|
30
|
+
*/
|
|
31
|
+
constructor(props: PauseOnExceptions.IProps);
|
|
32
|
+
private _build;
|
|
33
|
+
private _service;
|
|
34
|
+
private _command;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A namespace for the widget.
|
|
38
|
+
*/
|
|
39
|
+
export declare namespace PauseOnExceptions {
|
|
40
|
+
/**
|
|
41
|
+
* The properties of the widget and menu.
|
|
42
|
+
*/
|
|
43
|
+
interface IProps extends ToolbarButtonComponent.IProps {
|
|
44
|
+
/**
|
|
45
|
+
* The debugger service linked to the widget.
|
|
46
|
+
*/
|
|
47
|
+
service: IDebugger;
|
|
48
|
+
/**
|
|
49
|
+
* The commands registry and the command ID associated to the menu.
|
|
50
|
+
*/
|
|
51
|
+
commands: Breakpoints.ICommands;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { MenuSvg, ToolbarButton, ToolbarButtonComponent } from '@jupyterlab/ui-components';
|
|
5
|
+
const PAUSE_ON_EXCEPTION_CLASS = 'jp-debugger-pauseOnExceptions';
|
|
6
|
+
const PAUSE_ON_EXCEPTION_BUTTON_CLASS = 'jp-PauseOnExceptions';
|
|
7
|
+
const PAUSE_ON_EXCEPTION_MENU_CLASS = 'jp-PauseOnExceptions-menu';
|
|
8
|
+
/**
|
|
9
|
+
* A button which display a menu on click, to select the filter.
|
|
10
|
+
*/
|
|
11
|
+
export class PauseOnExceptionsWidget extends ToolbarButton {
|
|
12
|
+
/**
|
|
13
|
+
* Constructor of the button.
|
|
14
|
+
*/
|
|
15
|
+
constructor(props) {
|
|
16
|
+
super();
|
|
17
|
+
/**
|
|
18
|
+
* open menu on click.
|
|
19
|
+
*/
|
|
20
|
+
this.onclick = () => {
|
|
21
|
+
this._menu.open(this.node.getBoundingClientRect().left, this.node.getBoundingClientRect().bottom);
|
|
22
|
+
};
|
|
23
|
+
this._menu = new PauseOnExceptionsMenu({
|
|
24
|
+
service: props.service,
|
|
25
|
+
commands: {
|
|
26
|
+
registry: props.commands.registry,
|
|
27
|
+
pauseOnExceptions: props.commands.pauseOnExceptions
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
this.node.className = PAUSE_ON_EXCEPTION_CLASS;
|
|
31
|
+
this._props = props;
|
|
32
|
+
this._props.className = PAUSE_ON_EXCEPTION_BUTTON_CLASS;
|
|
33
|
+
this._props.service.eventMessage.connect((_, event) => {
|
|
34
|
+
if (event.event === 'initialized' || event.event === 'terminated') {
|
|
35
|
+
this.onChange();
|
|
36
|
+
}
|
|
37
|
+
}, this);
|
|
38
|
+
this._props.enabled = this._props.service.pauseOnExceptionsIsValid();
|
|
39
|
+
this._props.service.pauseOnExceptionChanged.connect(this.onChange, this);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Called when the debugger is initialized or the filter changed.
|
|
43
|
+
*/
|
|
44
|
+
onChange() {
|
|
45
|
+
var _a;
|
|
46
|
+
const session = this._props.service.session;
|
|
47
|
+
const exceptionBreakpointFilters = session === null || session === void 0 ? void 0 : session.exceptionBreakpointFilters;
|
|
48
|
+
this._props.className = PAUSE_ON_EXCEPTION_BUTTON_CLASS;
|
|
49
|
+
if (((_a = this._props.service.session) === null || _a === void 0 ? void 0 : _a.isStarted) && exceptionBreakpointFilters) {
|
|
50
|
+
if (session.isPausingOnException()) {
|
|
51
|
+
this._props.className += ' lm-mod-toggled';
|
|
52
|
+
}
|
|
53
|
+
this._props.enabled = true;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this._props.enabled = false;
|
|
57
|
+
}
|
|
58
|
+
this.update();
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
return React.createElement(ToolbarButtonComponent, { ...this._props, onClick: this.onclick });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A menu with all the available filter from the debugger as entries.
|
|
66
|
+
*/
|
|
67
|
+
export class PauseOnExceptionsMenu extends MenuSvg {
|
|
68
|
+
/**
|
|
69
|
+
* The constructor of the menu.
|
|
70
|
+
*/
|
|
71
|
+
constructor(props) {
|
|
72
|
+
super({ commands: props.commands.registry });
|
|
73
|
+
this._service = props.service;
|
|
74
|
+
this._command = props.commands.pauseOnExceptions;
|
|
75
|
+
props.service.eventMessage.connect((_, event) => {
|
|
76
|
+
if (event.event === 'initialized') {
|
|
77
|
+
this._build();
|
|
78
|
+
}
|
|
79
|
+
}, this);
|
|
80
|
+
this._build();
|
|
81
|
+
this.addClass(PAUSE_ON_EXCEPTION_MENU_CLASS);
|
|
82
|
+
}
|
|
83
|
+
_build() {
|
|
84
|
+
var _a, _b;
|
|
85
|
+
this.clearItems();
|
|
86
|
+
const exceptionsBreakpointFilters = (_b = (_a = this._service.session) === null || _a === void 0 ? void 0 : _a.exceptionBreakpointFilters) !== null && _b !== void 0 ? _b : [];
|
|
87
|
+
exceptionsBreakpointFilters.map((filter, _) => {
|
|
88
|
+
this.addItem({
|
|
89
|
+
command: this._command,
|
|
90
|
+
args: {
|
|
91
|
+
filter: filter.filter,
|
|
92
|
+
description: filter.description
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=pauseonexceptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pauseonexceptions.js","sourceRoot":"","sources":["../../../src/panels/breakpoints/pauseonexceptions.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,OAAO,EACP,aAAa,EACb,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AAInC,MAAM,wBAAwB,GAAG,+BAA+B,CAAC;AACjE,MAAM,+BAA+B,GAAG,sBAAsB,CAAC;AAC/D,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAElE;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,aAAa;IACxD;;OAEG;IACH,YAAY,KAA+B;QACzC,KAAK,EAAE,CAAC;Q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IAEO,MAAM;;QACZ,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,2BAA2B,GAC/B,MAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,0CAAE,0BAA0B,mCAAI,EAAE,CAAC;QAC1D,2BAA2B,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC5C,IAAI,CAAC,OAAO,CAAC;gBACX,OAAO,EAAE,IAAI,CAAC,QAAQ;gBACtB,IAAI,EAAE;oBACJ,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,WAAW,EAAE,MAAM,CAAC,WAAqB;iBAC1C;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CAIF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ReactWidget } from '@jupyterlab/ui-components';
|
|
2
|
+
import { ITranslator } from '@jupyterlab/translation';
|
|
3
|
+
import { IDebugger } from '../../tokens';
|
|
4
|
+
/**
|
|
5
|
+
* The body for a Sources Panel.
|
|
6
|
+
*/
|
|
7
|
+
export declare class KernelSourcesBody extends ReactWidget {
|
|
8
|
+
/**
|
|
9
|
+
* Instantiate a new Body for the KernelSourcesBody widget.
|
|
10
|
+
*
|
|
11
|
+
* @param options The instantiation options for a KernelSourcesBody.
|
|
12
|
+
*/
|
|
13
|
+
constructor(options: KernelSourcesBody.IOptions);
|
|
14
|
+
render(): JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* Show or hide the filter box.
|
|
17
|
+
*/
|
|
18
|
+
toggleFilterbox(): void;
|
|
19
|
+
private _model;
|
|
20
|
+
private _debuggerService;
|
|
21
|
+
private _trans;
|
|
22
|
+
private _showFilter;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A namespace for SourcesBody `statics`.
|
|
26
|
+
*/
|
|
27
|
+
export declare namespace KernelSourcesBody {
|
|
28
|
+
/**
|
|
29
|
+
* Instantiation options for `Breakpoints`.
|
|
30
|
+
*/
|
|
31
|
+
interface IOptions {
|
|
32
|
+
/**
|
|
33
|
+
* The debug service.
|
|
34
|
+
*/
|
|
35
|
+
service: IDebugger;
|
|
36
|
+
/**
|
|
37
|
+
* The sources model.
|
|
38
|
+
*/
|
|
39
|
+
model: IDebugger.Model.IKernelSources;
|
|
40
|
+
/**
|
|
41
|
+
* The application language translator
|
|
42
|
+
*/
|
|
43
|
+
translator?: ITranslator;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { openKernelSourceIcon } from '../../icons';
|
|
5
|
+
import { ReactWidget, ToolbarButtonComponent } from '@jupyterlab/ui-components';
|
|
6
|
+
import { showErrorMessage } from '@jupyterlab/apputils';
|
|
7
|
+
import { nullTranslator } from '@jupyterlab/translation';
|
|
8
|
+
import { KernelSourcesFilter } from './filter';
|
|
9
|
+
import { UseSignal } from '@jupyterlab/ui-components';
|
|
10
|
+
/**
|
|
11
|
+
* The class name added to the filterbox node.
|
|
12
|
+
*/
|
|
13
|
+
const FILTERBOX_CLASS = 'jp-DebuggerKernelSource-filterBox';
|
|
14
|
+
/**
|
|
15
|
+
* The class name added to hide the filterbox node.
|
|
16
|
+
*/
|
|
17
|
+
const FILTERBOX_HIDDEN_CLASS = 'jp-DebuggerKernelSource-filterBox-hidden';
|
|
18
|
+
/**
|
|
19
|
+
* The body for a Sources Panel.
|
|
20
|
+
*/
|
|
21
|
+
export class KernelSourcesBody extends ReactWidget {
|
|
22
|
+
/**
|
|
23
|
+
* Instantiate a new Body for the KernelSourcesBody widget.
|
|
24
|
+
*
|
|
25
|
+
* @param options The instantiation options for a KernelSourcesBody.
|
|
26
|
+
*/
|
|
27
|
+
constructor(options) {
|
|
28
|
+
var _a;
|
|
29
|
+
super();
|
|
30
|
+
this._showFilter = false;
|
|
31
|
+
this._model = options.model;
|
|
32
|
+
this._debuggerService = options.service;
|
|
33
|
+
this._trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : nullTranslator).load('jupyterlab');
|
|
34
|
+
this.addClass('jp-DebuggerKernelSources-body');
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
let filterClass = FILTERBOX_CLASS;
|
|
38
|
+
if (!this._showFilter) {
|
|
39
|
+
filterClass += ' ' + FILTERBOX_HIDDEN_CLASS;
|
|
40
|
+
}
|
|
41
|
+
return (React.createElement(React.Fragment, null,
|
|
42
|
+
React.createElement("div", { className: filterClass, key: 'filter' },
|
|
43
|
+
React.createElement(KernelSourcesFilter, { model: this._model })),
|
|
44
|
+
React.createElement(UseSignal, { signal: this._model.changed }, (_, kernelSources) => {
|
|
45
|
+
const keymap = {};
|
|
46
|
+
return (kernelSources !== null && kernelSources !== void 0 ? kernelSources : []).map(module => {
|
|
47
|
+
var _a;
|
|
48
|
+
const name = module.name;
|
|
49
|
+
const path = module.path;
|
|
50
|
+
const key = name + (keymap[name] = ((_a = keymap[name]) !== null && _a !== void 0 ? _a : 0) + 1).toString();
|
|
51
|
+
const button = (React.createElement(ToolbarButtonComponent, { key: key, icon: openKernelSourceIcon, label: name, tooltip: path, onClick: () => {
|
|
52
|
+
this._debuggerService
|
|
53
|
+
.getSource({
|
|
54
|
+
sourceReference: 0,
|
|
55
|
+
path: path
|
|
56
|
+
})
|
|
57
|
+
.then(source => {
|
|
58
|
+
this._model.open(source);
|
|
59
|
+
})
|
|
60
|
+
.catch(reason => {
|
|
61
|
+
void showErrorMessage(this._trans.__('Fail to get source'), this._trans.__("Fail to get '%1' source:\n%2", path, reason));
|
|
62
|
+
});
|
|
63
|
+
} }));
|
|
64
|
+
return button;
|
|
65
|
+
});
|
|
66
|
+
})));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Show or hide the filter box.
|
|
70
|
+
*/
|
|
71
|
+
toggleFilterbox() {
|
|
72
|
+
this._showFilter = !this._showFilter;
|
|
73
|
+
this.update();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/panels/kernelSources/body.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD;;GAEG;AACH,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAE5D;;GAEG;AACH,MAAM,sBAAsB,GAAG,0CAA0C,CAAC;AAE1E;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD;;;;OAIG;IACH,YAAY,OAAmC;;QAC7C,KAAK,EAAE,CAAC;QAyEF,gBAAW,GAAG,KAAK,CAAC;QAxE1B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,CAAC,MAAA,OAAO,CAAC,UAAU,mCAAI,cAAc,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAExE,IAAI,CAAC,QAAQ,CAAC,+BAA+B,CAAC,CAAC;IACjD,CAAC;IAED,MAAM;QACJ,IAAI,WAAW,GAAG,eAAe,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACrB,WAAW,IAAI,GAA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EACpC,IAAI,CAAC,MAAM,CAAC,EAAE,CACZ,8BAA8B,EAC9B,IAAI,EACJ,MAAM,CACP,CACF,CAAC;4BACJ,CAAC,CAAC,CAAC;wBACP,CAAC,GACD,CACH,CAAC;oBACF,OAAO,MAAM,CAAC;gBAChB,CAAC,CAAC,CAAC;YACL,CAAC,CACS,CACG,CAClB,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,eAAe;QACpB,IAAI,CAAC,WAAW,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC;QACrC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;CAMF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IDebugger } from '../../tokens';
|
|
2
|
+
/**
|
|
3
|
+
* The class name added to the filebrowser crumbs node.
|
|
4
|
+
*/
|
|
5
|
+
export interface IFilterBoxProps {
|
|
6
|
+
model: IDebugger.Model.IKernelSources;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A widget which hosts a input textbox to filter on file names.
|
|
10
|
+
*/
|
|
11
|
+
export declare const KernelSourcesFilter: (props: IFilterBoxProps) => JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import { InputGroup, UseSignal } from '@jupyterlab/ui-components';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
const FilterBox = (props) => {
|
|
6
|
+
const onFilterChange = (e) => {
|
|
7
|
+
const filter = e.target.value;
|
|
8
|
+
props.model.filter = filter;
|
|
9
|
+
};
|
|
10
|
+
return (React.createElement(InputGroup, { type: "text", onChange: onFilterChange, placeholder: "Filter the kernel sources", value: props.model.filter }));
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A widget which hosts a input textbox to filter on file names.
|
|
14
|
+
*/
|
|
15
|
+
export const KernelSourcesFilter = (props) => {
|
|
16
|
+
return (React.createElement(UseSignal, { signal: props.model.filterChanged, initialArgs: props.model.filter }, model => React.createElement(FilterBox, { model: props.model })));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../src/panels/kernelSources/filter.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,SAAS,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC3C,MAAM,cAAc,GAAG,CAAC,CAAM,EAAE,EAAE;QAChC,MAAM,MAAM,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC;QACpD,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAC9B,CAAC,CAAC;IACF,OAAO,CACL,oBAAC,UAAU,IACT,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAC,2BAA2B,EACvC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GACzB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC5D,OAAO,CACL,oBAAC,SAAS,IACR,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,aAAa,EACjC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,IAE9B,KAAK,CAAC,EAAE,CAAC,oBAAC,SAAS,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,CACjC,CACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ITranslator } from '@jupyterlab/translation';
|
|
2
|
+
import { PanelWithToolbar } from '@jupyterlab/ui-components';
|
|
3
|
+
import { IDebugger } from '../../tokens';
|
|
4
|
+
/**
|
|
5
|
+
* A Panel that shows a preview of the source code while debugging.
|
|
6
|
+
*/
|
|
7
|
+
export declare class KernelSources extends PanelWithToolbar {
|
|
8
|
+
/**
|
|
9
|
+
* Instantiate a new Sources preview Panel.
|
|
10
|
+
*
|
|
11
|
+
* @param options The Sources instantiation options.
|
|
12
|
+
*/
|
|
13
|
+
constructor(options: KernelSources.IOptions);
|
|
14
|
+
set filter(filter: string);
|
|
15
|
+
private _model;
|
|
16
|
+
private _body;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A namespace for `Sources` statics.
|
|
20
|
+
*/
|
|
21
|
+
export declare namespace KernelSources {
|
|
22
|
+
/**
|
|
23
|
+
* The options used to create a Sources.
|
|
24
|
+
*/
|
|
25
|
+
interface IOptions {
|
|
26
|
+
/**
|
|
27
|
+
* The debugger service.
|
|
28
|
+
*/
|
|
29
|
+
service: IDebugger;
|
|
30
|
+
/**
|
|
31
|
+
* The model for the sources.
|
|
32
|
+
*/
|
|
33
|
+
model: IDebugger.Model.IKernelSources;
|
|
34
|
+
/**
|
|
35
|
+
* The application language translator
|
|
36
|
+
*/
|
|
37
|
+
translator?: ITranslator;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import { nullTranslator } from '@jupyterlab/translation';
|
|
4
|
+
import { showErrorMessage } from '@jupyterlab/apputils';
|
|
5
|
+
import { PanelWithToolbar, refreshIcon, searchIcon, ToolbarButton } from '@jupyterlab/ui-components';
|
|
6
|
+
import { KernelSourcesBody } from './body';
|
|
7
|
+
/**
|
|
8
|
+
* A Panel that shows a preview of the source code while debugging.
|
|
9
|
+
*/
|
|
10
|
+
export class KernelSources extends PanelWithToolbar {
|
|
11
|
+
/**
|
|
12
|
+
* Instantiate a new Sources preview Panel.
|
|
13
|
+
*
|
|
14
|
+
* @param options The Sources instantiation options.
|
|
15
|
+
*/
|
|
16
|
+
constructor(options) {
|
|
17
|
+
var _a;
|
|
18
|
+
super();
|
|
19
|
+
const { model, service } = options;
|
|
20
|
+
this._model = model;
|
|
21
|
+
const trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : nullTranslator).load('jupyterlab');
|
|
22
|
+
this.title.label = trans.__('Kernel Sources');
|
|
23
|
+
this.toolbar.addClass('jp-DebuggerKernelSources-header');
|
|
24
|
+
this._body = new KernelSourcesBody({
|
|
25
|
+
service,
|
|
26
|
+
model,
|
|
27
|
+
translator: options.translator
|
|
28
|
+
});
|
|
29
|
+
this.toolbar.addItem('open-filter', new ToolbarButton({
|
|
30
|
+
icon: searchIcon,
|
|
31
|
+
onClick: async () => {
|
|
32
|
+
this._body.toggleFilterbox();
|
|
33
|
+
},
|
|
34
|
+
tooltip: trans.__('Toggle search filter')
|
|
35
|
+
}));
|
|
36
|
+
this.toolbar.addItem('refresh', new ToolbarButton({
|
|
37
|
+
icon: refreshIcon,
|
|
38
|
+
onClick: () => {
|
|
39
|
+
this._model.kernelSources = [];
|
|
40
|
+
void service.displayModules().catch(reason => {
|
|
41
|
+
void showErrorMessage(trans.__('Fail to get kernel sources'), trans.__('Fail to get kernel sources:\n%2', reason));
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
tooltip: trans.__('Refresh kernel sources')
|
|
45
|
+
}));
|
|
46
|
+
this.addClass('jp-DebuggerKernelSources-header');
|
|
47
|
+
this.addWidget(this._body);
|
|
48
|
+
this.addClass('jp-DebuggerKenelSources');
|
|
49
|
+
}
|
|
50
|
+
set filter(filter) {
|
|
51
|
+
this._model.filter = filter;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panels/kernelSources/index.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE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