@jupyterlab/debugger 3.3.0-alpha.6 → 4.0.0-alpha.1
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 +8 -1
- package/lib/debugger.js +9 -1
- package/lib/debugger.js.map +1 -1
- package/lib/handler.d.ts +31 -2
- package/lib/handler.js +61 -65
- package/lib/handler.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/model.d.ts +8 -1
- package/lib/model.js +10 -0
- package/lib/model.js.map +1 -1
- package/lib/panels/breakpoints/body.d.ts +0 -1
- package/lib/panels/breakpoints/index.d.ts +2 -1
- package/lib/panels/breakpoints/index.js +7 -10
- package/lib/panels/breakpoints/index.js.map +1 -1
- package/lib/panels/callstack/body.d.ts +0 -1
- package/lib/panels/callstack/index.d.ts +2 -1
- package/lib/panels/callstack/index.js +24 -20
- package/lib/panels/callstack/index.js.map +1 -1
- package/lib/panels/callstack/model.d.ts +3 -3
- package/lib/panels/callstack/model.js +3 -1
- package/lib/panels/callstack/model.js.map +1 -1
- package/lib/panels/sources/index.d.ts +2 -2
- package/lib/panels/sources/index.js +14 -9
- package/lib/panels/sources/index.js.map +1 -1
- package/lib/panels/sources/model.d.ts +2 -2
- package/lib/panels/sources/sourcepath.d.ts +10 -0
- package/lib/panels/sources/sourcepath.js +17 -0
- package/lib/panels/sources/sourcepath.js.map +1 -0
- package/lib/panels/variables/grid.d.ts +9 -0
- package/lib/panels/variables/grid.js +83 -9
- package/lib/panels/variables/grid.js.map +1 -1
- package/lib/panels/variables/index.d.ts +10 -2
- package/lib/panels/variables/index.js +36 -14
- package/lib/panels/variables/index.js.map +1 -1
- package/lib/panels/variables/mimerenderer.d.ts +31 -0
- package/lib/panels/variables/mimerenderer.js +44 -0
- package/lib/panels/variables/mimerenderer.js.map +1 -0
- package/lib/panels/variables/scope.d.ts +0 -1
- package/lib/panels/variables/tree.d.ts +17 -1
- package/lib/panels/variables/tree.js +44 -8
- package/lib/panels/variables/tree.js.map +1 -1
- package/lib/service.d.ts +14 -0
- package/lib/service.js +45 -13
- package/lib/service.js.map +1 -1
- package/lib/sidebar.d.ts +3 -40
- package/lib/sidebar.js +13 -60
- package/lib/sidebar.js.map +1 -1
- package/lib/tokens.d.ts +95 -16
- package/lib/tokens.js +4 -0
- package/lib/tokens.js.map +1 -1
- package/package.json +25 -25
- package/style/base.css +4 -0
- package/style/breakpoints.css +2 -0
- package/style/callstack.css +2 -0
- package/style/icons.css +4 -4
- package/style/sidebar.css +5 -52
- package/style/sources.css +6 -1
- package/style/variables.css +34 -4
- package/lib/panels/breakpoints/header.d.ts +0 -16
- package/lib/panels/breakpoints/header.js +0 -30
- package/lib/panels/breakpoints/header.js.map +0 -1
- package/lib/panels/callstack/header.d.ts +0 -16
- package/lib/panels/callstack/header.js +0 -30
- package/lib/panels/callstack/header.js.map +0 -1
- package/lib/panels/sources/header.d.ts +0 -19
- package/lib/panels/sources/header.js +0 -48
- package/lib/panels/sources/header.js.map +0 -1
- package/lib/panels/variables/header.d.ts +0 -16
- package/lib/panels/variables/header.js +0 -30
- package/lib/panels/variables/header.js.map +0 -1
|
@@ -1,50 +1,54 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
4
|
-
import { CommandToolbarButton } from '@jupyterlab/ui-components';
|
|
5
|
-
import { Panel } from '@lumino/widgets';
|
|
4
|
+
import { CommandToolbarButton, PanelWithToolbar } from '@jupyterlab/ui-components';
|
|
6
5
|
import { CallstackBody } from './body';
|
|
7
|
-
import { CallstackHeader } from './header';
|
|
8
6
|
/**
|
|
9
7
|
* A Panel to show a callstack.
|
|
10
8
|
*/
|
|
11
|
-
export class Callstack extends
|
|
9
|
+
export class Callstack extends PanelWithToolbar {
|
|
12
10
|
/**
|
|
13
11
|
* Instantiate a new Callstack Panel.
|
|
14
12
|
*
|
|
15
13
|
* @param options The instantiation options for a Callstack Panel.
|
|
16
14
|
*/
|
|
17
15
|
constructor(options) {
|
|
18
|
-
|
|
16
|
+
var _a;
|
|
17
|
+
super(options);
|
|
19
18
|
const { commands, model } = options;
|
|
20
|
-
const
|
|
21
|
-
|
|
19
|
+
const trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : nullTranslator).load('jupyterlab');
|
|
20
|
+
this.title.label = trans.__('Callstack');
|
|
22
21
|
const body = new CallstackBody(model);
|
|
23
|
-
|
|
22
|
+
this.toolbar.addItem('continue', new CommandToolbarButton({
|
|
24
23
|
commands: commands.registry,
|
|
25
|
-
id: commands.continue
|
|
24
|
+
id: commands.continue,
|
|
25
|
+
label: ''
|
|
26
26
|
}));
|
|
27
|
-
|
|
27
|
+
this.toolbar.addItem('terminate', new CommandToolbarButton({
|
|
28
28
|
commands: commands.registry,
|
|
29
|
-
id: commands.terminate
|
|
29
|
+
id: commands.terminate,
|
|
30
|
+
label: ''
|
|
30
31
|
}));
|
|
31
|
-
|
|
32
|
+
this.toolbar.addItem('step-over', new CommandToolbarButton({
|
|
32
33
|
commands: commands.registry,
|
|
33
|
-
id: commands.next
|
|
34
|
+
id: commands.next,
|
|
35
|
+
label: ''
|
|
34
36
|
}));
|
|
35
|
-
|
|
37
|
+
this.toolbar.addItem('step-in', new CommandToolbarButton({
|
|
36
38
|
commands: commands.registry,
|
|
37
|
-
id: commands.stepIn
|
|
39
|
+
id: commands.stepIn,
|
|
40
|
+
label: ''
|
|
38
41
|
}));
|
|
39
|
-
|
|
42
|
+
this.toolbar.addItem('step-out', new CommandToolbarButton({
|
|
40
43
|
commands: commands.registry,
|
|
41
|
-
id: commands.stepOut
|
|
44
|
+
id: commands.stepOut,
|
|
45
|
+
label: ''
|
|
42
46
|
}));
|
|
43
|
-
|
|
47
|
+
this.toolbar.addItem('evaluate', new CommandToolbarButton({
|
|
44
48
|
commands: commands.registry,
|
|
45
|
-
id: commands.evaluate
|
|
49
|
+
id: commands.evaluate,
|
|
50
|
+
label: ''
|
|
46
51
|
}));
|
|
47
|
-
this.addWidget(header);
|
|
48
52
|
this.addWidget(body);
|
|
49
53
|
this.addClass('jp-DebuggerCallstack');
|
|
50
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panels/callstack/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panels/callstack/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,gBAAgB;IAC7C;;;;OAIG;IACH,YAAY,OAA2B;;QACrC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QACpC,MAAM,KAAK,GAAG,OAAC,OAAO,CAAC,UAAU,mCAAI,cAAc,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;QAEtC,IAAI,CAAC,OAAO,CAAC,OAAO,CAClB,UAAU,EACV,IAAI,oBAAoB,CAAC;YACvB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,EAAE,EAAE,QAAQ,CAAC,QAAQ;YACr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16
|
* Get the current frame.
|
|
17
17
|
*/
|
|
18
|
-
get frame(): IDebugger.IStackFrame;
|
|
18
|
+
get frame(): IDebugger.IStackFrame | null;
|
|
19
19
|
/**
|
|
20
20
|
* Set the current frame.
|
|
21
21
|
*/
|
|
22
|
-
set frame(frame: IDebugger.IStackFrame);
|
|
22
|
+
set frame(frame: IDebugger.IStackFrame | null);
|
|
23
23
|
/**
|
|
24
24
|
* Signal emitted when the frames have changed.
|
|
25
25
|
*/
|
|
@@ -27,7 +27,7 @@ export declare class CallstackModel implements IDebugger.Model.ICallstack {
|
|
|
27
27
|
/**
|
|
28
28
|
* Signal emitted when the current frame has changed.
|
|
29
29
|
*/
|
|
30
|
-
get currentFrameChanged(): ISignal<this, IDebugger.IStackFrame>;
|
|
30
|
+
get currentFrameChanged(): ISignal<this, IDebugger.IStackFrame | null>;
|
|
31
31
|
private _state;
|
|
32
32
|
private _currentFrame;
|
|
33
33
|
private _framesChanged;
|
|
@@ -7,6 +7,7 @@ import { Signal } from '@lumino/signaling';
|
|
|
7
7
|
export class CallstackModel {
|
|
8
8
|
constructor() {
|
|
9
9
|
this._state = [];
|
|
10
|
+
this._currentFrame = null;
|
|
10
11
|
this._framesChanged = new Signal(this);
|
|
11
12
|
this._currentFrameChanged = new Signal(this);
|
|
12
13
|
}
|
|
@@ -21,7 +22,8 @@ export class CallstackModel {
|
|
|
21
22
|
*/
|
|
22
23
|
set frames(newFrames) {
|
|
23
24
|
this._state = newFrames;
|
|
24
|
-
const
|
|
25
|
+
const currentFrameId = this.frame !== null ? Private.getFrameId(this.frame) : '';
|
|
26
|
+
const frame = newFrames.find(frame => Private.getFrameId(frame) === currentFrameId);
|
|
25
27
|
// Default to the first frame if the previous one can't be found.
|
|
26
28
|
// Otherwise keep the current frame selected.
|
|
27
29
|
if (!frame) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/panels/callstack/model.ts"],"names":[],"mappings":"AAAA,0C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AC;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,KAAmC;QAC3C,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACnC,CAAC;CAQF;AAED;;GAEG;AACH,IAAU,OAAO,CAShB;AATD,WAAU,OAAO;IACf;;;;OAIG;IACH,SAAgB,UAAU,CAAC,KAA4B;;QACrD,OAAO,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,0CAAE,IAAI,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,EAAE,EAAE,CAAC;IAC/C,CAAC;IAFe,kBAAU,aAEzB,CAAA;AACH,CAAC,EATS,OAAO,KAAP,OAAO,QAShB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IEditorServices } from '@jupyterlab/codeeditor';
|
|
2
2
|
import { ITranslator } from '@jupyterlab/translation';
|
|
3
|
-
import {
|
|
3
|
+
import { PanelWithToolbar } from '@jupyterlab/ui-components';
|
|
4
4
|
import { IDebugger } from '../../tokens';
|
|
5
5
|
/**
|
|
6
6
|
* A Panel that shows a preview of the source code while debugging.
|
|
7
7
|
*/
|
|
8
|
-
export declare class Sources extends
|
|
8
|
+
export declare class Sources extends PanelWithToolbar {
|
|
9
9
|
/**
|
|
10
10
|
* Instantiate a new Sources preview Panel.
|
|
11
11
|
*
|
|
@@ -3,38 +3,43 @@
|
|
|
3
3
|
| Distributed under the terms of the Modified BSD License.
|
|
4
4
|
|----------------------------------------------------------------------------*/
|
|
5
5
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
6
|
-
import { ToolbarButton } from '@jupyterlab/ui-components';
|
|
7
|
-
import { Panel } from '@lumino/widgets';
|
|
6
|
+
import { PanelWithToolbar, ToolbarButton } from '@jupyterlab/ui-components';
|
|
8
7
|
import { viewBreakpointIcon } from '../../icons';
|
|
8
|
+
import { SourcePathComponent } from './sourcepath';
|
|
9
9
|
import { SourcesBody } from './body';
|
|
10
|
-
import {
|
|
10
|
+
import { ReactWidget } from '@jupyterlab/ui-components';
|
|
11
|
+
import React from 'react';
|
|
11
12
|
/**
|
|
12
13
|
* A Panel that shows a preview of the source code while debugging.
|
|
13
14
|
*/
|
|
14
|
-
export class Sources extends
|
|
15
|
+
export class Sources extends PanelWithToolbar {
|
|
15
16
|
/**
|
|
16
17
|
* Instantiate a new Sources preview Panel.
|
|
17
18
|
*
|
|
18
19
|
* @param options The Sources instantiation options.
|
|
19
20
|
*/
|
|
20
21
|
constructor(options) {
|
|
22
|
+
var _a;
|
|
21
23
|
super();
|
|
22
24
|
const { model, service, editorServices } = options;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
const trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : nullTranslator).load('jupyterlab');
|
|
26
|
+
this.title.label = trans.__('Source');
|
|
27
|
+
this.toolbar.addClass('jp-DebuggerSources-header');
|
|
26
28
|
const body = new SourcesBody({
|
|
27
29
|
service,
|
|
28
30
|
model,
|
|
29
31
|
editorServices
|
|
30
32
|
});
|
|
31
|
-
|
|
33
|
+
this.toolbar.addItem('open', new ToolbarButton({
|
|
32
34
|
icon: viewBreakpointIcon,
|
|
33
35
|
onClick: () => model.open(),
|
|
34
36
|
tooltip: trans.__('Open in the Main Area')
|
|
35
37
|
}));
|
|
36
|
-
|
|
38
|
+
const sourcePath = ReactWidget.create(React.createElement(SourcePathComponent, { model: model }));
|
|
39
|
+
this.toolbar.addItem('sourcePath', sourcePath);
|
|
40
|
+
this.addClass('jp-DebuggerSources-header');
|
|
37
41
|
this.addWidget(body);
|
|
42
|
+
this.addClass('jp-DebuggerSources');
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panels/sources/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panels/sources/index.tsx"],"names":[],"mappings":"AAAA;;;+EAG+E;AAG/E,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,gBAAgB;IAC3C;;;;OAIG;IACH,YAAY,OAAyB;;QACnC,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;QACnD,MAAM,KAAK,GAAG,OAAC,OAAO,CAAC,UAAU,mCAAI,cAAc,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QAEtC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC;YAC3B,OAAO;YACP,KAAK;YACL,cAAc;SACf,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,OAAO,CAClB,MAAM,EACN,IAAI,aAAa,CAAC;YAChB,IAAI,EAAE,kBAAkB;YACxB,OAAO,EAAE,GAAS,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE;YACjC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAAC;SAC3C,CAAC,CACH,CAAC;QACF,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CACnC,oBAAC,mBAAmB,IAAC,KAAK,EAAE,KAAK,GAAI,CACtC,CAAC;QAEF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;QAE3C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -13,7 +13,7 @@ export declare class SourcesModel implements IDebugger.Model.ISources {
|
|
|
13
13
|
/**
|
|
14
14
|
* Signal emitted when the current frame changes.
|
|
15
15
|
*/
|
|
16
|
-
readonly currentFrameChanged: ISignal<IDebugger.Model.ICallstack, IDebugger.IStackFrame>;
|
|
16
|
+
readonly currentFrameChanged: ISignal<IDebugger.Model.ICallstack, IDebugger.IStackFrame | null>;
|
|
17
17
|
/**
|
|
18
18
|
* Signal emitted when a source should be open in the main area.
|
|
19
19
|
*/
|
|
@@ -51,6 +51,6 @@ export declare namespace SourcesModel {
|
|
|
51
51
|
/**
|
|
52
52
|
* Signal emitted when the current frame changes.
|
|
53
53
|
*/
|
|
54
|
-
currentFrameChanged: ISignal<IDebugger.Model.ICallstack, IDebugger.IStackFrame>;
|
|
54
|
+
currentFrameChanged: ISignal<IDebugger.Model.ICallstack, IDebugger.IStackFrame | null>;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDebugger } from '../../tokens';
|
|
2
|
+
/**
|
|
3
|
+
* A React component to display the path to a source.
|
|
4
|
+
*
|
|
5
|
+
* @param {object} props The component props.
|
|
6
|
+
* @param props.model The model for the sources.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SourcePathComponent: ({ model }: {
|
|
9
|
+
model: IDebugger.Model.ISources;
|
|
10
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import { UseSignal } from '@jupyterlab/ui-components';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* A React component to display the path to a source.
|
|
7
|
+
*
|
|
8
|
+
* @param {object} props The component props.
|
|
9
|
+
* @param props.model The model for the sources.
|
|
10
|
+
*/
|
|
11
|
+
export const SourcePathComponent = ({ model }) => {
|
|
12
|
+
return (React.createElement(UseSignal, { signal: model.currentSourceChanged, initialSender: model }, (model) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return (React.createElement("span", { onClick: () => model === null || model === void 0 ? void 0 : model.open() }, (_b = (_a = model === null || model === void 0 ? void 0 : model.currentSource) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : ''));
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=sourcepath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourcepath.js","sourceRoot":"","sources":["../../../src/panels/sources/sourcepath.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,KAAK,EAGN,EAAe,EAAE;IAChB,OAAO,CACL,oBAAC,SAAS,IAAC,MAAM,EAAE,KAAK,CAAC,oBAAoB,EAAE,aAAa,EAAE,KAAK,IAChE,CAAC,KAAK,EAAe,EAAE;;QAAC,OAAA,CACvB,8BAAM,OAAO,EAAE,GAAS,EAAE,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,EAAE,gBACrC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,0CAAE,IAAI,mCAAI,EAAE,CAC5B,CACR,CAAA;KAAA,CACS,CACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { IThemeManager } from '@jupyterlab/apputils';
|
|
|
2
2
|
import { CommandRegistry } from '@lumino/commands';
|
|
3
3
|
import { Panel } from '@lumino/widgets';
|
|
4
4
|
import { IDebugger } from '../../tokens';
|
|
5
|
+
import { ITranslator } from '@jupyterlab/translation';
|
|
5
6
|
/**
|
|
6
7
|
* A data grid that displays variables in a debugger session.
|
|
7
8
|
*/
|
|
@@ -12,6 +13,10 @@ export declare class VariablesBodyGrid extends Panel {
|
|
|
12
13
|
* @param options The instantiation options for a VariablesBodyGrid.
|
|
13
14
|
*/
|
|
14
15
|
constructor(options: VariablesBodyGrid.IOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Get the latest hit variable
|
|
18
|
+
*/
|
|
19
|
+
get latestSelection(): IDebugger.IVariableSelection | null;
|
|
15
20
|
/**
|
|
16
21
|
* Set the variable filter list.
|
|
17
22
|
*
|
|
@@ -55,5 +60,9 @@ export declare namespace VariablesBodyGrid {
|
|
|
55
60
|
* An optional application theme manager to detect theme changes.
|
|
56
61
|
*/
|
|
57
62
|
themeManager?: IThemeManager | null;
|
|
63
|
+
/**
|
|
64
|
+
* The application language translator.
|
|
65
|
+
*/
|
|
66
|
+
translator?: ITranslator;
|
|
58
67
|
}
|
|
59
68
|
}
|
|
@@ -4,6 +4,7 @@ import { BasicKeyHandler, BasicMouseHandler, BasicSelectionModel, DataGrid, Data
|
|
|
4
4
|
import { Signal } from '@lumino/signaling';
|
|
5
5
|
import { Panel } from '@lumino/widgets';
|
|
6
6
|
import { Debugger } from '../../';
|
|
7
|
+
import { nullTranslator } from '@jupyterlab/translation';
|
|
7
8
|
/**
|
|
8
9
|
* A data grid that displays variables in a debugger session.
|
|
9
10
|
*/
|
|
@@ -15,8 +16,8 @@ export class VariablesBodyGrid extends Panel {
|
|
|
15
16
|
*/
|
|
16
17
|
constructor(options) {
|
|
17
18
|
super();
|
|
18
|
-
const { model, commands, themeManager, scopes } = options;
|
|
19
|
-
this._grid = new Grid({ commands, themeManager });
|
|
19
|
+
const { model, commands, themeManager, scopes, translator } = options;
|
|
20
|
+
this._grid = new Grid({ commands, themeManager, translator });
|
|
20
21
|
this._grid.addClass('jp-DebuggerVariables-grid');
|
|
21
22
|
this._model = model;
|
|
22
23
|
this._model.changed.connect((model) => {
|
|
@@ -26,6 +27,12 @@ export class VariablesBodyGrid extends Panel {
|
|
|
26
27
|
this.addWidget(this._grid);
|
|
27
28
|
this.addClass('jp-DebuggerVariables-body');
|
|
28
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the latest hit variable
|
|
32
|
+
*/
|
|
33
|
+
get latestSelection() {
|
|
34
|
+
return this._grid.latestSelection;
|
|
35
|
+
}
|
|
29
36
|
/**
|
|
30
37
|
* Set the variable filter list.
|
|
31
38
|
*
|
|
@@ -63,14 +70,24 @@ class Grid extends Panel {
|
|
|
63
70
|
*/
|
|
64
71
|
constructor(options) {
|
|
65
72
|
super();
|
|
73
|
+
this._latestSelection = null;
|
|
66
74
|
const { commands, themeManager } = options;
|
|
67
|
-
const dataModel = new GridModel();
|
|
75
|
+
const dataModel = new GridModel(options.translator);
|
|
68
76
|
const grid = new DataGrid();
|
|
69
77
|
const mouseHandler = new Private.MouseHandler();
|
|
70
78
|
mouseHandler.doubleClicked.connect((_, hit) => commands.execute(Debugger.CommandIDs.inspectVariable, {
|
|
71
79
|
variableReference: dataModel.getVariableReference(hit.row),
|
|
72
|
-
|
|
80
|
+
name: dataModel.getVariableName(hit.row)
|
|
73
81
|
}));
|
|
82
|
+
mouseHandler.selected.connect((_, hit) => {
|
|
83
|
+
const { row } = hit;
|
|
84
|
+
this._latestSelection = {
|
|
85
|
+
name: dataModel.getVariableName(row),
|
|
86
|
+
value: dataModel.data('body', row, 1),
|
|
87
|
+
type: dataModel.data('body', row, 2),
|
|
88
|
+
variablesReference: dataModel.getVariableReference(row)
|
|
89
|
+
};
|
|
90
|
+
});
|
|
74
91
|
grid.dataModel = dataModel;
|
|
75
92
|
grid.keyHandler = new BasicKeyHandler();
|
|
76
93
|
grid.mouseHandler = mouseHandler;
|
|
@@ -110,6 +127,12 @@ class Grid extends Panel {
|
|
|
110
127
|
get dataModel() {
|
|
111
128
|
return this._grid.dataModel;
|
|
112
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Get the latest hit variable
|
|
132
|
+
*/
|
|
133
|
+
get latestSelection() {
|
|
134
|
+
return this._latestSelection;
|
|
135
|
+
}
|
|
113
136
|
/**
|
|
114
137
|
* Handle `after-attach` messages.
|
|
115
138
|
*
|
|
@@ -132,8 +155,12 @@ class Grid extends Panel {
|
|
|
132
155
|
* A data grid model for variables.
|
|
133
156
|
*/
|
|
134
157
|
class GridModel extends DataModel {
|
|
135
|
-
|
|
136
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Create gird model
|
|
160
|
+
* @param translator optional translator
|
|
161
|
+
*/
|
|
162
|
+
constructor(translator) {
|
|
163
|
+
super();
|
|
137
164
|
this._filter = new Set();
|
|
138
165
|
this._scope = '';
|
|
139
166
|
this._data = {
|
|
@@ -142,6 +169,8 @@ class GridModel extends DataModel {
|
|
|
142
169
|
value: [],
|
|
143
170
|
variablesReference: []
|
|
144
171
|
};
|
|
172
|
+
translator = translator || nullTranslator;
|
|
173
|
+
this._trans = translator.load('jupyterlab');
|
|
145
174
|
}
|
|
146
175
|
/**
|
|
147
176
|
* Set the variable filter list.
|
|
@@ -189,10 +218,10 @@ class GridModel extends DataModel {
|
|
|
189
218
|
return this._data.name[row];
|
|
190
219
|
}
|
|
191
220
|
if (region === 'column-header') {
|
|
192
|
-
return column === 1 ? 'Value' : 'Type';
|
|
221
|
+
return column === 1 ? this._trans.__('Value') : this._trans.__('Type');
|
|
193
222
|
}
|
|
194
223
|
if (region === 'corner-header') {
|
|
195
|
-
return 'Name';
|
|
224
|
+
return this._trans.__('Name');
|
|
196
225
|
}
|
|
197
226
|
return column === 1 ? this._data.value[row] : this._data.type[row];
|
|
198
227
|
}
|
|
@@ -215,7 +244,7 @@ class GridModel extends DataModel {
|
|
|
215
244
|
/**
|
|
216
245
|
* Set the datagrid model data from the list of variables.
|
|
217
246
|
*
|
|
218
|
-
* @param
|
|
247
|
+
* @param scopes The list of variables.
|
|
219
248
|
*/
|
|
220
249
|
setData(scopes) {
|
|
221
250
|
var _a, _b;
|
|
@@ -324,6 +353,7 @@ var Private;
|
|
|
324
353
|
constructor() {
|
|
325
354
|
super(...arguments);
|
|
326
355
|
this._doubleClicked = new Signal(this);
|
|
356
|
+
this._selected = new Signal(this);
|
|
327
357
|
}
|
|
328
358
|
/**
|
|
329
359
|
* A signal emitted when the variables grid is double clicked.
|
|
@@ -331,6 +361,22 @@ var Private;
|
|
|
331
361
|
get doubleClicked() {
|
|
332
362
|
return this._doubleClicked;
|
|
333
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* A signal emitted when the variables grid received mouse down or context menu event.
|
|
366
|
+
*/
|
|
367
|
+
get selected() {
|
|
368
|
+
return this._selected;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Dispose of the resources held by the mouse handler.
|
|
372
|
+
*/
|
|
373
|
+
dispose() {
|
|
374
|
+
if (this.isDisposed) {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
Signal.disconnectSender(this);
|
|
378
|
+
super.dispose();
|
|
379
|
+
}
|
|
334
380
|
/**
|
|
335
381
|
* Handle a mouse double-click event.
|
|
336
382
|
*
|
|
@@ -341,6 +387,34 @@ var Private;
|
|
|
341
387
|
const hit = grid.hitTest(event.clientX, event.clientY);
|
|
342
388
|
this._doubleClicked.emit(hit);
|
|
343
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* Handle the mouse down event for the data grid.
|
|
392
|
+
*
|
|
393
|
+
* @param grid - The data grid of interest.
|
|
394
|
+
*
|
|
395
|
+
* @param event - The mouse down event of interest.
|
|
396
|
+
*/
|
|
397
|
+
onMouseDown(grid, event) {
|
|
398
|
+
// Unpack the event.
|
|
399
|
+
let { clientX, clientY } = event;
|
|
400
|
+
// Hit test the grid.
|
|
401
|
+
let hit = grid.hitTest(clientX, clientY);
|
|
402
|
+
this._selected.emit(hit);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Handle the context menu event for the data grid.
|
|
406
|
+
*
|
|
407
|
+
* @param grid - The data grid of interest.
|
|
408
|
+
*
|
|
409
|
+
* @param event - The context menu event of interest.
|
|
410
|
+
*/
|
|
411
|
+
onContextMenu(grid, event) {
|
|
412
|
+
// Unpack the event.
|
|
413
|
+
let { clientX, clientY } = event;
|
|
414
|
+
// Hit test the grid.
|
|
415
|
+
let hit = grid.hitTest(clientX, clientY);
|
|
416
|
+
this._selected.emit(hit);
|
|
417
|
+
}
|
|
344
418
|
}
|
|
345
419
|
Private.MouseHandler = MouseHandler;
|
|
346
420
|
})(Private || (Private = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../src/panels/variables/grid.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAM3D,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,YAAY,EACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../src/panels/variables/grid.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAM3D,OA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;YACL,IAAI,IAAI,CAAC,UAAU,EAAE;gBACnB,OAAO;aACR;YAED,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAE9B,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;QAED;;;;;WAKG;QACH,kBAAkB,CAAC,IAAc,EAAE,KAAiB;YAClD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACvD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;QAED;;;;;;WAMG;QACH,WAAW,CAAC,IAAc,EAAE,KAAiB;YAC3C,oBAAoB;YACpB,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;YAEjC,qBAAqB;YACrB,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEzC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QAED;;;;;;WAMG;QACH,aAAa,CAAC,IAAc,EAAE,KAAiB;YAC7C,oBAAoB;YACpB,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;YAEjC,qBAAqB;YACrB,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEzC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;KAIF;IA3EY,oBAAY,eA2ExB,CAAA;AACH,CAAC,EAhJS,OAAO,KAAP,OAAO,QAgJhB"}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { IThemeManager } from '@jupyterlab/apputils';
|
|
2
2
|
import { ITranslator } from '@jupyterlab/translation';
|
|
3
|
+
import { PanelWithToolbar } from '@jupyterlab/ui-components';
|
|
3
4
|
import { CommandRegistry } from '@lumino/commands';
|
|
4
5
|
import { Panel, Widget } from '@lumino/widgets';
|
|
5
6
|
import { IDebugger } from '../../tokens';
|
|
6
7
|
/**
|
|
7
8
|
* A Panel to show a variable explorer.
|
|
8
9
|
*/
|
|
9
|
-
export declare class Variables extends
|
|
10
|
+
export declare class Variables extends PanelWithToolbar implements IDebugger.IVariablesPanel {
|
|
10
11
|
/**
|
|
11
12
|
* Instantiate a new Variables Panel.
|
|
12
13
|
*
|
|
13
14
|
* @param options The instantiation options for a Variables Panel.
|
|
14
15
|
*/
|
|
15
16
|
constructor(options: Variables.IOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Latest variable selected.
|
|
19
|
+
*/
|
|
20
|
+
get latestSelection(): IDebugger.IVariableSelection | null;
|
|
21
|
+
/**
|
|
22
|
+
* Get the variable explorer view mode
|
|
23
|
+
*/
|
|
24
|
+
get viewMode(): 'tree' | 'table';
|
|
16
25
|
/**
|
|
17
26
|
* Set the variable filter for both the tree and table views.
|
|
18
27
|
*/
|
|
@@ -29,7 +38,6 @@ export declare class Variables extends Panel {
|
|
|
29
38
|
* @param msg The resize message.
|
|
30
39
|
*/
|
|
31
40
|
private _resizeBody;
|
|
32
|
-
private _header;
|
|
33
41
|
private _tree;
|
|
34
42
|
private _table;
|
|
35
43
|
}
|
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
4
|
-
import { tableRowsIcon, ToolbarButton, treeViewIcon } from '@jupyterlab/ui-components';
|
|
5
|
-
import { Panel } from '@lumino/widgets';
|
|
4
|
+
import { PanelWithToolbar, tableRowsIcon, ToolbarButton, treeViewIcon } from '@jupyterlab/ui-components';
|
|
6
5
|
import { VariablesBodyGrid } from './grid';
|
|
7
|
-
import { VariablesHeader } from './header';
|
|
8
6
|
import { ScopeSwitcher } from './scope';
|
|
9
7
|
import { VariablesBodyTree } from './tree';
|
|
10
8
|
/**
|
|
11
9
|
* A Panel to show a variable explorer.
|
|
12
10
|
*/
|
|
13
|
-
export class Variables extends
|
|
11
|
+
export class Variables extends PanelWithToolbar {
|
|
14
12
|
/**
|
|
15
13
|
* Instantiate a new Variables Panel.
|
|
16
14
|
*
|
|
17
15
|
* @param options The instantiation options for a Variables Panel.
|
|
18
16
|
*/
|
|
19
17
|
constructor(options) {
|
|
20
|
-
super();
|
|
18
|
+
super(options);
|
|
21
19
|
const { model, service, commands, themeManager } = options;
|
|
22
20
|
const translator = options.translator || nullTranslator;
|
|
23
21
|
const trans = translator.load('jupyterlab');
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
22
|
+
this.title.label = trans.__('Variables');
|
|
23
|
+
this.toolbar.addClass('jp-DebuggerVariables-toolbar');
|
|
24
|
+
this._tree = new VariablesBodyTree({
|
|
25
|
+
model,
|
|
26
|
+
service,
|
|
27
|
+
commands,
|
|
28
|
+
translator
|
|
29
|
+
});
|
|
30
|
+
this._table = new VariablesBodyGrid({
|
|
31
|
+
model,
|
|
32
|
+
commands,
|
|
33
|
+
themeManager,
|
|
34
|
+
translator
|
|
35
|
+
});
|
|
27
36
|
this._table.hide();
|
|
28
|
-
this.
|
|
37
|
+
this.toolbar.addItem('scope-switcher', new ScopeSwitcher({
|
|
29
38
|
translator,
|
|
30
39
|
model,
|
|
31
40
|
tree: this._tree,
|
|
@@ -69,14 +78,27 @@ export class Variables extends Panel {
|
|
|
69
78
|
tableViewButton.addClass(viewModeClassName);
|
|
70
79
|
}
|
|
71
80
|
};
|
|
72
|
-
markViewButtonSelection(this.
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
75
|
-
this.addWidget(this._header);
|
|
81
|
+
markViewButtonSelection(this.viewMode);
|
|
82
|
+
this.toolbar.addItem('view-VariableTreeView', treeViewButton);
|
|
83
|
+
this.toolbar.addItem('view-VariableTableView', tableViewButton);
|
|
76
84
|
this.addWidget(this._tree);
|
|
77
85
|
this.addWidget(this._table);
|
|
78
86
|
this.addClass('jp-DebuggerVariables');
|
|
79
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Latest variable selected.
|
|
90
|
+
*/
|
|
91
|
+
get latestSelection() {
|
|
92
|
+
return this._table.isHidden
|
|
93
|
+
? this._tree.latestSelection
|
|
94
|
+
: this._table.latestSelection;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get the variable explorer view mode
|
|
98
|
+
*/
|
|
99
|
+
get viewMode() {
|
|
100
|
+
return this._table.isHidden ? 'tree' : 'table';
|
|
101
|
+
}
|
|
80
102
|
/**
|
|
81
103
|
* Set the variable filter for both the tree and table views.
|
|
82
104
|
*/
|
|
@@ -99,7 +121,7 @@ export class Variables extends Panel {
|
|
|
99
121
|
* @param msg The resize message.
|
|
100
122
|
*/
|
|
101
123
|
_resizeBody(msg) {
|
|
102
|
-
const height = msg.height - this.
|
|
124
|
+
const height = msg.height - this.toolbar.node.offsetHeight;
|
|
103
125
|
this._tree.node.style.height = `${height}px`;
|
|
104
126
|
}
|
|
105
127
|
}
|