@theia/debug 1.34.0-next.39 → 1.34.0
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/browser/debug-frontend-application-contribution.js +2 -2
- package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
- package/lib/browser/debug-preferences.js +1 -1
- package/lib/browser/debug-preferences.js.map +1 -1
- package/lib/browser/debug-session-manager.d.ts +1 -0
- package/lib/browser/debug-session-manager.d.ts.map +1 -1
- package/lib/browser/debug-session-manager.js +3 -0
- package/lib/browser/debug-session-manager.js.map +1 -1
- package/lib/browser/debug-session.d.ts +31 -2
- package/lib/browser/debug-session.d.ts.map +1 -1
- package/lib/browser/debug-session.js +81 -27
- package/lib/browser/debug-session.js.map +1 -1
- package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.js +4 -4
- package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.js.map +1 -1
- package/lib/browser/disassembly-view/disassembly-view-contribution.js +1 -1
- package/lib/browser/disassembly-view/disassembly-view-contribution.js.map +1 -1
- package/lib/browser/disassembly-view/disassembly-view-widget.js +3 -3
- package/lib/browser/disassembly-view/disassembly-view-widget.js.map +1 -1
- package/lib/browser/model/debug-stack-frame.d.ts +6 -0
- package/lib/browser/model/debug-stack-frame.d.ts.map +1 -1
- package/lib/browser/model/debug-stack-frame.js +13 -7
- package/lib/browser/model/debug-stack-frame.js.map +1 -1
- package/lib/browser/view/debug-action.d.ts.map +1 -1
- package/lib/browser/view/debug-action.js +5 -2
- package/lib/browser/view/debug-action.js.map +1 -1
- package/lib/browser/view/debug-toolbar-widget.d.ts +8 -1
- package/lib/browser/view/debug-toolbar-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-toolbar-widget.js +45 -2
- package/lib/browser/view/debug-toolbar-widget.js.map +1 -1
- package/lib/browser/view/debug-watch-expression.js +1 -1
- package/lib/browser/view/debug-watch-expression.js.map +1 -1
- package/package.json +15 -15
- package/src/browser/debug-frontend-application-contribution.ts +2 -2
- package/src/browser/debug-preferences.ts +1 -1
- package/src/browser/debug-session-manager.ts +5 -1
- package/src/browser/debug-session.tsx +79 -26
- package/src/browser/disassembly-view/disassembly-view-accessibility-provider.ts +4 -4
- package/src/browser/disassembly-view/disassembly-view-contribution.ts +1 -1
- package/src/browser/disassembly-view/disassembly-view-widget.ts +3 -3
- package/src/browser/model/debug-stack-frame.tsx +14 -6
- package/src/browser/style/index.css +15 -1
- package/src/browser/view/debug-action.tsx +7 -2
- package/src/browser/view/debug-toolbar-widget.tsx +44 -3
- package/src/browser/view/debug-watch-expression.tsx +1 -1
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as React from '@theia/core/shared/react';
|
|
3
|
-
import { DisposableCollection, MenuPath } from '@theia/core';
|
|
3
|
+
import { CommandMenuNode, CommandRegistry, DisposableCollection, MenuModelRegistry, MenuPath } from '@theia/core';
|
|
4
|
+
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
4
5
|
import { ReactWidget } from '@theia/core/lib/browser/widgets';
|
|
5
6
|
import { DebugViewModel } from './debug-view-model';
|
|
6
7
|
import { DebugAction } from './debug-action';
|
|
7
8
|
export declare class DebugToolBar extends ReactWidget {
|
|
8
9
|
static readonly MENU: MenuPath;
|
|
10
|
+
protected readonly commandRegistry: CommandRegistry;
|
|
11
|
+
protected readonly menuModelRegistry: MenuModelRegistry;
|
|
12
|
+
protected readonly contextKeyService: ContextKeyService;
|
|
9
13
|
protected readonly model: DebugViewModel;
|
|
10
14
|
protected readonly onRender: DisposableCollection;
|
|
11
15
|
protected init(): void;
|
|
@@ -14,6 +18,9 @@ export declare class DebugToolBar extends ReactWidget {
|
|
|
14
18
|
protected stepRef: DebugAction | undefined;
|
|
15
19
|
protected setStepRef: (stepRef: DebugAction | null) => void;
|
|
16
20
|
protected render(): React.ReactNode;
|
|
21
|
+
protected renderContributedCommands(): React.ReactNode;
|
|
22
|
+
protected matchContext(when?: string): boolean;
|
|
23
|
+
protected debugAction(commandMenuNode: CommandMenuNode): React.ReactNode;
|
|
17
24
|
protected renderStart(): React.ReactNode;
|
|
18
25
|
protected renderContinue(): React.ReactNode;
|
|
19
26
|
protected start: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-toolbar-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/view/debug-toolbar-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,OAAO,
|
|
1
|
+
{"version":3,"file":"debug-toolbar-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/view/debug-toolbar-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAgC,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,qBACa,YAAa,SAAQ,WAAW;IAEzC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAA0B;IAE/B,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAClD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACxD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC3D,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAEjE,SAAS,CAAC,QAAQ,CAAC,QAAQ,uBAA8B;IAGzD,SAAS,CAAC,IAAI,IAAI,IAAI;IAStB,KAAK,IAAI,IAAI;IAMb,SAAS,CAAC,OAAO,IAAI,OAAO;IAO5B,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IAC3C,SAAS,CAAC,UAAU,YAAa,WAAW,GAAG,IAAI,UAGjD;IAEF,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;IAiBnC,SAAS,CAAC,yBAAyB,IAAI,KAAK,CAAC,SAAS;IAgBtD,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO;IAI9C,SAAS,CAAC,WAAW,CAAC,eAAe,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS;IAgBxE,SAAS,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS;IAOxC,SAAS,CAAC,cAAc,IAAI,KAAK,CAAC,SAAS;IAQ3C,SAAS,CAAC,KAAK,sBAA4B;IAC3C,SAAS,CAAC,OAAO,sBAA8B;IAC/C,SAAS,CAAC,IAAI,sBAAgC;IAC9C,SAAS,CAAC,QAAQ,4FAAyE;IAC3F,SAAS,CAAC,KAAK,yFAAsE;IACrF,SAAS,CAAC,QAAQ,wFAAyE;IAC3F,SAAS,CAAC,MAAM,0FAAuE;IACvF,SAAS,CAAC,OAAO,2FAAwE;CAE5F"}
|
|
@@ -23,17 +23,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
23
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
24
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
25
|
};
|
|
26
|
+
var DebugToolBar_1;
|
|
26
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
28
|
exports.DebugToolBar = void 0;
|
|
28
29
|
const React = require("@theia/core/shared/react");
|
|
29
30
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
31
|
const core_1 = require("@theia/core");
|
|
32
|
+
const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
|
|
31
33
|
const widgets_1 = require("@theia/core/lib/browser/widgets");
|
|
32
34
|
const debug_view_model_1 = require("./debug-view-model");
|
|
33
35
|
const debug_session_1 = require("../debug-session");
|
|
34
36
|
const debug_action_1 = require("./debug-action");
|
|
35
37
|
const nls_1 = require("@theia/core/lib/common/nls");
|
|
36
|
-
let DebugToolBar = class DebugToolBar extends widgets_1.ReactWidget {
|
|
38
|
+
let DebugToolBar = DebugToolBar_1 = class DebugToolBar extends widgets_1.ReactWidget {
|
|
37
39
|
constructor() {
|
|
38
40
|
super(...arguments);
|
|
39
41
|
this.onRender = new core_1.DisposableCollection();
|
|
@@ -74,6 +76,7 @@ let DebugToolBar = class DebugToolBar extends widgets_1.ReactWidget {
|
|
|
74
76
|
render() {
|
|
75
77
|
const { state } = this.model;
|
|
76
78
|
return React.createElement(React.Fragment, null,
|
|
79
|
+
this.renderContributedCommands(),
|
|
77
80
|
this.renderContinue(),
|
|
78
81
|
React.createElement(debug_action_1.DebugAction, { enabled: state === debug_session_1.DebugState.Stopped, run: this.stepOver, label: nls_1.nls.localizeByDefault('Step Over'), iconClass: 'debug-step-over', ref: this.setStepRef }),
|
|
79
82
|
React.createElement(debug_action_1.DebugAction, { enabled: state === debug_session_1.DebugState.Stopped, run: this.stepIn, label: nls_1.nls.localizeByDefault('Step Into'), iconClass: 'debug-step-into' }),
|
|
@@ -81,6 +84,34 @@ let DebugToolBar = class DebugToolBar extends widgets_1.ReactWidget {
|
|
|
81
84
|
React.createElement(debug_action_1.DebugAction, { enabled: state !== debug_session_1.DebugState.Inactive, run: this.restart, label: nls_1.nls.localizeByDefault('Restart'), iconClass: 'debug-restart' }),
|
|
82
85
|
this.renderStart());
|
|
83
86
|
}
|
|
87
|
+
renderContributedCommands() {
|
|
88
|
+
const debugActions = [];
|
|
89
|
+
// first, search for CompoundMenuNodes:
|
|
90
|
+
this.menuModelRegistry.getMenu(DebugToolBar_1.MENU).children.forEach(compoundMenuNode => {
|
|
91
|
+
if (core_1.CompoundMenuNode.is(compoundMenuNode) && this.matchContext(compoundMenuNode.when)) {
|
|
92
|
+
// second, search for nested CommandMenuNodes:
|
|
93
|
+
compoundMenuNode.children.forEach(commandMenuNode => {
|
|
94
|
+
if (core_1.CommandMenuNode.is(commandMenuNode) && this.matchContext(commandMenuNode.when)) {
|
|
95
|
+
debugActions.push(this.debugAction(commandMenuNode));
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return debugActions;
|
|
101
|
+
}
|
|
102
|
+
matchContext(when) {
|
|
103
|
+
return !when || this.contextKeyService.match(when);
|
|
104
|
+
}
|
|
105
|
+
debugAction(commandMenuNode) {
|
|
106
|
+
const { command, icon = '', label = '' } = commandMenuNode;
|
|
107
|
+
if (!label && !icon) {
|
|
108
|
+
const { when } = commandMenuNode;
|
|
109
|
+
console.warn(`Neither 'label' nor 'icon' properties were defined for the command menu node. (${JSON.stringify({ command, when })}}. Skipping.`);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const run = () => this.commandRegistry.executeCommand(command);
|
|
113
|
+
return React.createElement(debug_action_1.DebugAction, { key: command, enabled: true, label: label, iconClass: icon, run: run });
|
|
114
|
+
}
|
|
84
115
|
renderStart() {
|
|
85
116
|
const { state } = this.model;
|
|
86
117
|
if (state === debug_session_1.DebugState.Inactive && this.model.sessionCount === 1) {
|
|
@@ -97,6 +128,18 @@ let DebugToolBar = class DebugToolBar extends widgets_1.ReactWidget {
|
|
|
97
128
|
}
|
|
98
129
|
};
|
|
99
130
|
DebugToolBar.MENU = ['debug-toolbar-menu'];
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, inversify_1.inject)(core_1.CommandRegistry),
|
|
133
|
+
__metadata("design:type", core_1.CommandRegistry)
|
|
134
|
+
], DebugToolBar.prototype, "commandRegistry", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, inversify_1.inject)(core_1.MenuModelRegistry),
|
|
137
|
+
__metadata("design:type", core_1.MenuModelRegistry)
|
|
138
|
+
], DebugToolBar.prototype, "menuModelRegistry", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, inversify_1.inject)(context_key_service_1.ContextKeyService),
|
|
141
|
+
__metadata("design:type", Object)
|
|
142
|
+
], DebugToolBar.prototype, "contextKeyService", void 0);
|
|
100
143
|
__decorate([
|
|
101
144
|
(0, inversify_1.inject)(debug_view_model_1.DebugViewModel),
|
|
102
145
|
__metadata("design:type", debug_view_model_1.DebugViewModel)
|
|
@@ -107,7 +150,7 @@ __decorate([
|
|
|
107
150
|
__metadata("design:paramtypes", []),
|
|
108
151
|
__metadata("design:returntype", void 0)
|
|
109
152
|
], DebugToolBar.prototype, "init", null);
|
|
110
|
-
DebugToolBar = __decorate([
|
|
153
|
+
DebugToolBar = DebugToolBar_1 = __decorate([
|
|
111
154
|
(0, inversify_1.injectable)()
|
|
112
155
|
], DebugToolBar);
|
|
113
156
|
exports.DebugToolBar = DebugToolBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-toolbar-widget.js","sourceRoot":"","sources":["../../../src/browser/view/debug-toolbar-widget.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF
|
|
1
|
+
{"version":3,"file":"debug-toolbar-widget.js","sourceRoot":"","sources":["../../../src/browser/view/debug-toolbar-widget.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;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1.ExpressionItem {
|
|
|
40
40
|
this.options.onDidChange();
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
|
-
return React.createElement("div", { className: 'theia-debug-console-variable' },
|
|
43
|
+
return React.createElement("div", { className: 'theia-debug-console-variable theia-debug-watch-expression' },
|
|
44
44
|
React.createElement("div", { className: browser_1.TREE_NODE_SEGMENT_GROW_CLASS },
|
|
45
45
|
React.createElement("span", { title: this.type || this._expression, className: 'name' },
|
|
46
46
|
this._expression,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-watch-expression.js","sourceRoot":"","sources":["../../../src/browser/view/debug-watch-expression.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,kDAAkD;AAClD,6DAAwE;AACxE,wEAAsF;AAEtF,qDAAgF;AAChF,sCAAkC;AAElC,MAAa,oBAAqB,SAAQ,oCAAc;IAKpD,YAA+B,OAM9B;QACG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAPhB,YAAO,GAAP,OAAO,CAMrC;QAmDS,gBAAW,GAAG,CAAC,QAAgC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,SAAS,CAAC;QAjDhG,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;IACzB,CAAC;IAEQ,KAAK,CAAC,QAAQ;QACnB,MAAM,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAEkB,SAAS,CAAC,IAA6C,EAAE,KAAc;QACtF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE;YACzB,OAAO;SACV;QACD,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAC/B,CAAC;IAEQ,MAAM;QACX,OAAO,6BAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"debug-watch-expression.js","sourceRoot":"","sources":["../../../src/browser/view/debug-watch-expression.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,kDAAkD;AAClD,6DAAwE;AACxE,wEAAsF;AAEtF,qDAAgF;AAChF,sCAAkC;AAElC,MAAa,oBAAqB,SAAQ,oCAAc;IAKpD,YAA+B,OAM9B;QACG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAPhB,YAAO,GAAP,OAAO,CAMrC;QAmDS,gBAAW,GAAG,CAAC,QAAgC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,SAAS,CAAC;QAjDhG,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;IACzB,CAAC;IAEQ,KAAK,CAAC,QAAQ;QACnB,MAAM,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAEkB,SAAS,CAAC,IAA6C,EAAE,KAAc;QACtF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE;YACzB,OAAO;SACV;QACD,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7B,IAAI,C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,SAAS;QACL,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,QAAQ,IAAI,SAAS,EAAE;YAC5B,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC3C,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SAChC;IACL,CAAC;CAIJ;AAhED,oDAgEC"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/debug",
|
|
3
|
-
"version": "1.34.0
|
|
3
|
+
"version": "1.34.0",
|
|
4
4
|
"description": "Theia - Debug Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/console": "1.34.0
|
|
7
|
-
"@theia/core": "1.34.0
|
|
8
|
-
"@theia/editor": "1.34.0
|
|
9
|
-
"@theia/filesystem": "1.34.0
|
|
10
|
-
"@theia/markers": "1.34.0
|
|
11
|
-
"@theia/monaco": "1.34.0
|
|
6
|
+
"@theia/console": "1.34.0",
|
|
7
|
+
"@theia/core": "1.34.0",
|
|
8
|
+
"@theia/editor": "1.34.0",
|
|
9
|
+
"@theia/filesystem": "1.34.0",
|
|
10
|
+
"@theia/markers": "1.34.0",
|
|
11
|
+
"@theia/monaco": "1.34.0",
|
|
12
12
|
"@theia/monaco-editor-core": "1.72.3",
|
|
13
|
-
"@theia/output": "1.34.0
|
|
14
|
-
"@theia/process": "1.34.0
|
|
15
|
-
"@theia/task": "1.34.0
|
|
16
|
-
"@theia/terminal": "1.34.0
|
|
17
|
-
"@theia/variable-resolver": "1.34.0
|
|
18
|
-
"@theia/workspace": "1.34.0
|
|
13
|
+
"@theia/output": "1.34.0",
|
|
14
|
+
"@theia/process": "1.34.0",
|
|
15
|
+
"@theia/task": "1.34.0",
|
|
16
|
+
"@theia/terminal": "1.34.0",
|
|
17
|
+
"@theia/variable-resolver": "1.34.0",
|
|
18
|
+
"@theia/workspace": "1.34.0",
|
|
19
19
|
"@vscode/debugprotocol": "^1.51.0",
|
|
20
20
|
"jsonc-parser": "^2.2.0",
|
|
21
21
|
"mkdirp": "^0.5.0",
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"watch": "theiaext watch"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@theia/ext-scripts": "1.
|
|
66
|
+
"@theia/ext-scripts": "1.34.0"
|
|
67
67
|
},
|
|
68
68
|
"nyc": {
|
|
69
69
|
"extends": "../../configs/nyc.json"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "a8c403b103829a1b8b092ce741ef3826804f773b"
|
|
72
72
|
}
|
|
@@ -483,8 +483,8 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
|
|
|
483
483
|
action: async () => {
|
|
484
484
|
if (this.manager.currentSession) {
|
|
485
485
|
const msg = this.manager.sessions.length === 1
|
|
486
|
-
? nls.
|
|
487
|
-
: nls.
|
|
486
|
+
? nls.localizeByDefault('There is an active debug session, are you sure you want to stop it?')
|
|
487
|
+
: nls.localizeByDefault('There are active debug sessions, are you sure you want to stop them?');
|
|
488
488
|
const safeToExit = await new ConfirmDialog({
|
|
489
489
|
title: '',
|
|
490
490
|
msg,
|
|
@@ -62,7 +62,7 @@ export const debugPreferencesSchema: PreferenceSchema = {
|
|
|
62
62
|
default: 'never'
|
|
63
63
|
},
|
|
64
64
|
'debug.disassemblyView.showSourceCode': {
|
|
65
|
-
description: nls.
|
|
65
|
+
description: nls.localizeByDefault('Show Source Code in Disassembly View.'),
|
|
66
66
|
type: 'boolean',
|
|
67
67
|
default: true,
|
|
68
68
|
}
|
|
@@ -27,7 +27,7 @@ import { DebugConfiguration } from '../common/debug-common';
|
|
|
27
27
|
import { DebugError, DebugService } from '../common/debug-service';
|
|
28
28
|
import { BreakpointManager } from './breakpoint/breakpoint-manager';
|
|
29
29
|
import { DebugConfigurationManager } from './debug-configuration-manager';
|
|
30
|
-
import { DebugSession, DebugState } from './debug-session';
|
|
30
|
+
import { DebugSession, DebugState, debugStateContextValue } from './debug-session';
|
|
31
31
|
import { DebugSessionContributionRegistry, DebugSessionFactory } from './debug-session-contribution';
|
|
32
32
|
import { DebugCompoundRoot, DebugCompoundSessionOptions, DebugConfigurationSessionOptions, DebugSessionOptions, InternalDebugSessionOptions } from './debug-session-options';
|
|
33
33
|
import { DebugStackFrame } from './model/debug-stack-frame';
|
|
@@ -106,7 +106,9 @@ export class DebugSessionManager {
|
|
|
106
106
|
protected readonly onDidChangeEmitter = new Emitter<DebugSession | undefined>();
|
|
107
107
|
readonly onDidChange: Event<DebugSession | undefined> = this.onDidChangeEmitter.event;
|
|
108
108
|
protected fireDidChange(current: DebugSession | undefined): void {
|
|
109
|
+
this.debugTypeKey.set(current?.configuration.type);
|
|
109
110
|
this.inDebugModeKey.set(this.inDebugMode);
|
|
111
|
+
this.debugStateKey.set(debugStateContextValue(this.state));
|
|
110
112
|
this.onDidChangeEmitter.fire(current);
|
|
111
113
|
}
|
|
112
114
|
|
|
@@ -154,11 +156,13 @@ export class DebugSessionManager {
|
|
|
154
156
|
|
|
155
157
|
protected debugTypeKey: ContextKey<string>;
|
|
156
158
|
protected inDebugModeKey: ContextKey<boolean>;
|
|
159
|
+
protected debugStateKey: ContextKey<string>;
|
|
157
160
|
|
|
158
161
|
@postConstruct()
|
|
159
162
|
protected init(): void {
|
|
160
163
|
this.debugTypeKey = this.contextKeyService.createKey<string>('debugType', undefined);
|
|
161
164
|
this.inDebugModeKey = this.contextKeyService.createKey<boolean>('inDebugMode', this.inDebugMode);
|
|
165
|
+
this.debugStateKey = this.contextKeyService.createKey<string>('debugState', debugStateContextValue(this.state));
|
|
162
166
|
this.breakpoints.onDidChangeMarkers(uri => this.fireDidChangeBreakpoints({ uri }));
|
|
163
167
|
this.labelProvider.onDidChange(event => {
|
|
164
168
|
for (const uriString of this.breakpoints.getUris()) {
|
|
@@ -50,6 +50,18 @@ export enum DebugState {
|
|
|
50
50
|
Running,
|
|
51
51
|
Stopped
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The mapped string values must not change as they are used for the `debugState` when context closure.
|
|
55
|
+
* For more details see the `Debugger contexts` section of the [official doc](https://code.visualstudio.com/api/references/when-clause-contexts#available-contexts).
|
|
56
|
+
*/
|
|
57
|
+
export function debugStateContextValue(state: DebugState): string {
|
|
58
|
+
switch (state) {
|
|
59
|
+
case DebugState.Initializing: return 'initializing';
|
|
60
|
+
case DebugState.Stopped: return 'stopped';
|
|
61
|
+
case DebugState.Running: return 'running';
|
|
62
|
+
default: return 'inactive';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
53
65
|
|
|
54
66
|
// FIXME: make injectable to allow easily inject services
|
|
55
67
|
export class DebugSession implements CompositeTreeElement {
|
|
@@ -74,7 +86,7 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
74
86
|
protected readonly childSessions = new Map<string, DebugSession>();
|
|
75
87
|
protected readonly toDispose = new DisposableCollection();
|
|
76
88
|
|
|
77
|
-
|
|
89
|
+
protected isStopping: boolean = false;
|
|
78
90
|
|
|
79
91
|
constructor(
|
|
80
92
|
readonly id: string,
|
|
@@ -89,6 +101,10 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
89
101
|
protected readonly fileService: FileService,
|
|
90
102
|
protected readonly debugContributionProvider: ContributionProvider<DebugContribution>,
|
|
91
103
|
protected readonly workspaceService: WorkspaceService,
|
|
104
|
+
/**
|
|
105
|
+
* Number of millis after a `stop` request times out. It's 5 seconds by default.
|
|
106
|
+
*/
|
|
107
|
+
protected readonly stopTimeout = 5_000,
|
|
92
108
|
) {
|
|
93
109
|
this.connection.onRequest('runInTerminal', (request: DebugProtocol.RunInTerminalRequest) => this.runInTerminal(request));
|
|
94
110
|
this.connection.onDidClose(() => {
|
|
@@ -274,19 +290,25 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
274
290
|
}
|
|
275
291
|
|
|
276
292
|
protected async initialize(): Promise<void> {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
293
|
+
try {
|
|
294
|
+
const response = await this.connection.sendRequest('initialize', {
|
|
295
|
+
clientID: 'Theia',
|
|
296
|
+
clientName: 'Theia IDE',
|
|
297
|
+
adapterID: this.configuration.type,
|
|
298
|
+
locale: 'en-US',
|
|
299
|
+
linesStartAt1: true,
|
|
300
|
+
columnsStartAt1: true,
|
|
301
|
+
pathFormat: 'path',
|
|
302
|
+
supportsVariableType: false,
|
|
303
|
+
supportsVariablePaging: false,
|
|
304
|
+
supportsRunInTerminalRequest: true
|
|
305
|
+
});
|
|
306
|
+
this.updateCapabilities(response?.body || {});
|
|
307
|
+
this.didReceiveCapabilities.resolve();
|
|
308
|
+
} catch (err) {
|
|
309
|
+
this.didReceiveCapabilities.reject(err);
|
|
310
|
+
throw err;
|
|
311
|
+
}
|
|
290
312
|
}
|
|
291
313
|
|
|
292
314
|
protected async launchOrAttach(): Promise<void> {
|
|
@@ -304,8 +326,17 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
304
326
|
}
|
|
305
327
|
}
|
|
306
328
|
|
|
329
|
+
/**
|
|
330
|
+
* The `send('initialize')` request could resolve later than `on('initialized')` emits the event.
|
|
331
|
+
* Hence, the `configure` would use the empty object `capabilities`.
|
|
332
|
+
* Using the empty `capabilities` could result in missing exception breakpoint filters, as
|
|
333
|
+
* always `capabilities.exceptionBreakpointFilters` is falsy. This deferred promise works
|
|
334
|
+
* around this timing issue. https://github.com/eclipse-theia/theia/issues/11886
|
|
335
|
+
*/
|
|
336
|
+
protected didReceiveCapabilities = new Deferred<void>();
|
|
307
337
|
protected initialized = false;
|
|
308
338
|
protected async configure(): Promise<void> {
|
|
339
|
+
await this.didReceiveCapabilities.promise;
|
|
309
340
|
if (this.capabilities.exceptionBreakpointFilters) {
|
|
310
341
|
const exceptionBreakpoints = [];
|
|
311
342
|
for (const filter of this.capabilities.exceptionBreakpointFilters) {
|
|
@@ -340,24 +371,39 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
340
371
|
if (!this.isStopping) {
|
|
341
372
|
this.isStopping = true;
|
|
342
373
|
if (this.canTerminate()) {
|
|
343
|
-
const terminated = this.waitFor('terminated',
|
|
374
|
+
const terminated = this.waitFor('terminated', this.stopTimeout);
|
|
344
375
|
try {
|
|
345
|
-
await this.connection.sendRequest('terminate', { restart: isRestart },
|
|
376
|
+
await this.connection.sendRequest('terminate', { restart: isRestart }, this.stopTimeout);
|
|
346
377
|
await terminated;
|
|
347
378
|
} catch (e) {
|
|
348
|
-
|
|
379
|
+
this.handleTerminateError(e);
|
|
349
380
|
}
|
|
350
381
|
} else {
|
|
382
|
+
const terminateDebuggee = this.initialized && this.capabilities.supportTerminateDebuggee;
|
|
351
383
|
try {
|
|
352
|
-
await this.sendRequest('disconnect', { restart: isRestart },
|
|
384
|
+
await this.sendRequest('disconnect', { restart: isRestart, terminateDebuggee }, this.stopTimeout);
|
|
353
385
|
} catch (e) {
|
|
354
|
-
|
|
386
|
+
this.handleDisconnectError(e);
|
|
355
387
|
}
|
|
356
388
|
}
|
|
357
389
|
callback();
|
|
358
390
|
}
|
|
359
391
|
}
|
|
360
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Invoked when sending the `terminate` request to the debugger is rejected or timed out.
|
|
395
|
+
*/
|
|
396
|
+
protected handleTerminateError(err: unknown): void {
|
|
397
|
+
console.error('Did not receive terminated event in time', err);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Invoked when sending the `disconnect` request to the debugger is rejected or timed out.
|
|
402
|
+
*/
|
|
403
|
+
protected handleDisconnectError(err: unknown): void {
|
|
404
|
+
console.error('Error on disconnect', err);
|
|
405
|
+
}
|
|
406
|
+
|
|
361
407
|
async disconnect(isRestart: boolean, callback: () => void): Promise<void> {
|
|
362
408
|
if (!this.isStopping) {
|
|
363
409
|
this.isStopping = true;
|
|
@@ -665,12 +711,17 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
665
711
|
const response = await this.sendRequest('setFunctionBreakpoints', {
|
|
666
712
|
breakpoints: enabled.map(b => b.origin.raw)
|
|
667
713
|
});
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
714
|
+
// Apparently, `body` and `breakpoints` can be missing.
|
|
715
|
+
// https://github.com/eclipse-theia/theia/issues/11885
|
|
716
|
+
// https://github.com/microsoft/vscode/blob/80004351ccf0884b58359f7c8c801c91bb827d83/src/vs/workbench/contrib/debug/browser/debugSession.ts#L448-L449
|
|
717
|
+
if (response && response.body) {
|
|
718
|
+
response.body.breakpoints.forEach((raw, index) => {
|
|
719
|
+
// node debug adapter returns more breakpoints sometimes
|
|
720
|
+
if (enabled[index]) {
|
|
721
|
+
enabled[index].update({ raw });
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
}
|
|
674
725
|
} catch (error) {
|
|
675
726
|
// could be error or promise rejection of DebugProtocol.SetFunctionBreakpoints
|
|
676
727
|
if (error instanceof Error) {
|
|
@@ -699,10 +750,12 @@ export class DebugSession implements CompositeTreeElement {
|
|
|
699
750
|
);
|
|
700
751
|
const enabled = all.filter(b => b.enabled);
|
|
701
752
|
try {
|
|
753
|
+
const breakpoints = enabled.map(({ origin }) => origin.raw);
|
|
702
754
|
const response = await this.sendRequest('setBreakpoints', {
|
|
703
755
|
source: source.raw,
|
|
704
756
|
sourceModified,
|
|
705
|
-
breakpoints
|
|
757
|
+
breakpoints,
|
|
758
|
+
lines: breakpoints.map(({ line }) => line)
|
|
706
759
|
});
|
|
707
760
|
response.body.breakpoints.forEach((raw, index) => {
|
|
708
761
|
// node debug adapter returns more breakpoints sometimes
|
|
@@ -23,7 +23,7 @@ import { DisassembledInstructionEntry } from './disassembly-view-utilities';
|
|
|
23
23
|
export class AccessibilityProvider implements IListAccessibilityProvider<DisassembledInstructionEntry> {
|
|
24
24
|
|
|
25
25
|
getWidgetAriaLabel(): string {
|
|
26
|
-
return nls.
|
|
26
|
+
return nls.localizeByDefault('Disassembly View');
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
getAriaLabel(element: DisassembledInstructionEntry): string | null {
|
|
@@ -31,12 +31,12 @@ export class AccessibilityProvider implements IListAccessibilityProvider<Disasse
|
|
|
31
31
|
|
|
32
32
|
const instruction = element.instruction;
|
|
33
33
|
if (instruction.address !== '-1') {
|
|
34
|
-
label += `${nls.
|
|
34
|
+
label += `${nls.localizeByDefault('Address')}: ${instruction.address}`;
|
|
35
35
|
}
|
|
36
36
|
if (instruction.instructionBytes) {
|
|
37
|
-
label += `, ${nls.
|
|
37
|
+
label += `, ${nls.localizeByDefault('Bytes')}: ${instruction.instructionBytes}`;
|
|
38
38
|
}
|
|
39
|
-
label += `, ${nls.
|
|
39
|
+
label += `, ${nls.localizeByDefault('Instruction')}: ${instruction.instruction}`;
|
|
40
40
|
|
|
41
41
|
return label;
|
|
42
42
|
}
|
|
@@ -28,7 +28,7 @@ import { DebugStackFramesWidget } from '../view/debug-stack-frames-widget';
|
|
|
28
28
|
|
|
29
29
|
export const OPEN_DISASSEMBLY_VIEW_COMMAND: Command = {
|
|
30
30
|
id: 'open-disassembly-view',
|
|
31
|
-
label: nls.
|
|
31
|
+
label: nls.localizeByDefault('Open Disassembly View')
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export const LANGUAGE_SUPPORTS_DISASSEMBLE_REQUEST = 'languageSupportsDisassembleRequest';
|
|
@@ -51,7 +51,7 @@ const disassemblyNotAvailable: DisassembledInstructionEntry = {
|
|
|
51
51
|
isBreakpointEnabled: false,
|
|
52
52
|
instruction: {
|
|
53
53
|
address: '-1',
|
|
54
|
-
instruction: nls.
|
|
54
|
+
instruction: nls.localizeByDefault('Disassembly not available.')
|
|
55
55
|
},
|
|
56
56
|
instructionAddress: BigInt(-1)
|
|
57
57
|
} as const;
|
|
@@ -82,7 +82,7 @@ export class DisassemblyViewWidget extends BaseWidget {
|
|
|
82
82
|
this.id = DisassemblyViewWidget.ID;
|
|
83
83
|
this.addClass(DisassemblyViewWidget.ID);
|
|
84
84
|
this.title.closable = true;
|
|
85
|
-
this.title.label = nls.
|
|
85
|
+
this.title.label = nls.localizeByDefault('Disassembly');
|
|
86
86
|
const updateIcon = () => this.title.iconClass = this.labelProvider.getIcon(this.iconReferenceUri) + ' file-icon';
|
|
87
87
|
updateIcon();
|
|
88
88
|
this.toDispose.push(this.labelProvider.onDidChange(updateIcon));
|
|
@@ -239,7 +239,7 @@ export class DisassemblyViewWidget extends BaseWidget {
|
|
|
239
239
|
project(row: DisassembledInstructionEntry): DisassembledInstructionEntry { return row; }
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
|
-
label: nls.
|
|
242
|
+
label: nls.localizeByDefault('instructions'),
|
|
243
243
|
tooltip: '',
|
|
244
244
|
weight: 0.3,
|
|
245
245
|
templateId: InstructionRenderer.TEMPLATE_ID,
|
|
@@ -64,28 +64,36 @@ export class DebugStackFrame extends DebugStackFrameData implements TreeElement
|
|
|
64
64
|
}));
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
async open(options
|
|
68
|
-
mode: 'reveal'
|
|
69
|
-
}): Promise<EditorWidget | undefined> {
|
|
67
|
+
async open(options?: WidgetOpenerOptions): Promise<EditorWidget | undefined> {
|
|
70
68
|
if (!this.source) {
|
|
71
69
|
return undefined;
|
|
72
70
|
}
|
|
73
71
|
const { line, column, endLine, endColumn } = this.raw;
|
|
74
72
|
const selection: RecursivePartial<Range> = {
|
|
75
|
-
start: Position.create(line - 1, column - 1)
|
|
73
|
+
start: Position.create(this.clampPositive(line - 1), this.clampPositive(column - 1))
|
|
76
74
|
};
|
|
77
75
|
if (typeof endLine === 'number') {
|
|
78
76
|
selection.end = {
|
|
79
|
-
line: endLine - 1,
|
|
80
|
-
character: typeof endColumn === 'number' ? endColumn - 1 : undefined
|
|
77
|
+
line: this.clampPositive(endLine - 1),
|
|
78
|
+
character: typeof endColumn === 'number' ? this.clampPositive(endColumn - 1) : undefined
|
|
81
79
|
};
|
|
82
80
|
}
|
|
83
81
|
this.source.open({
|
|
82
|
+
mode: 'reveal',
|
|
84
83
|
...options,
|
|
85
84
|
selection
|
|
86
85
|
});
|
|
87
86
|
}
|
|
88
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Debugger can send `column: 0` value despite of initializing the debug session with `columnsStartAt1: true`.
|
|
90
|
+
* This method can be used to ensure that neither `column` nor `column` are negative numbers.
|
|
91
|
+
* See https://github.com/microsoft/vscode-mock-debug/issues/85.
|
|
92
|
+
*/
|
|
93
|
+
protected clampPositive(value: number): number {
|
|
94
|
+
return Math.max(value, 0);
|
|
95
|
+
}
|
|
96
|
+
|
|
89
97
|
protected scopes: Promise<DebugScope[]> | undefined;
|
|
90
98
|
getScopes(): Promise<DebugScope[]> {
|
|
91
99
|
return this.scopes || (this.scopes = this.doGetScopes());
|
|
@@ -146,6 +146,17 @@
|
|
|
146
146
|
opacity: 1;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
.debug-toolbar .debug-action>div {
|
|
150
|
+
font-family: var(--theia-ui-font-family);
|
|
151
|
+
font-size: var(--theia-ui-font-size0);
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
align-self: center;
|
|
155
|
+
justify-content: center;
|
|
156
|
+
text-align: center;
|
|
157
|
+
min-height: inherit;
|
|
158
|
+
}
|
|
159
|
+
|
|
149
160
|
/** Console */
|
|
150
161
|
|
|
151
162
|
#debug-console .theia-console-info {
|
|
@@ -169,7 +180,6 @@
|
|
|
169
180
|
}
|
|
170
181
|
|
|
171
182
|
.theia-debug-console-variable {
|
|
172
|
-
display: flex;
|
|
173
183
|
white-space: nowrap;
|
|
174
184
|
overflow: hidden;
|
|
175
185
|
text-overflow: ellipsis;
|
|
@@ -209,6 +219,10 @@
|
|
|
209
219
|
color: var(--theia-debugConsole-errorForeground);
|
|
210
220
|
}
|
|
211
221
|
|
|
222
|
+
.theia-debug-watch-expression {
|
|
223
|
+
display: flex;
|
|
224
|
+
}
|
|
225
|
+
|
|
212
226
|
/** Editor **/
|
|
213
227
|
|
|
214
228
|
.theia-debug-breakpoint-icon {
|
|
@@ -21,7 +21,10 @@ export class DebugAction extends React.Component<DebugAction.Props> {
|
|
|
21
21
|
|
|
22
22
|
override render(): React.ReactNode {
|
|
23
23
|
const { enabled, label, iconClass } = this.props;
|
|
24
|
-
const classNames = ['debug-action'
|
|
24
|
+
const classNames = ['debug-action'];
|
|
25
|
+
if (iconClass) {
|
|
26
|
+
classNames.push(...codiconArray(iconClass, true));
|
|
27
|
+
}
|
|
25
28
|
if (enabled === false) {
|
|
26
29
|
classNames.push(DISABLED_CLASS);
|
|
27
30
|
}
|
|
@@ -29,7 +32,9 @@ export class DebugAction extends React.Component<DebugAction.Props> {
|
|
|
29
32
|
className={classNames.join(' ')}
|
|
30
33
|
title={label}
|
|
31
34
|
onClick={this.props.run}
|
|
32
|
-
ref={this.setRef}
|
|
35
|
+
ref={this.setRef} >
|
|
36
|
+
{!iconClass && <div>{label}</div>}
|
|
37
|
+
</span>;
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
focus(): void {
|