@theia/debug 1.45.0 → 1.46.0-next.72
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/README.md +62 -62
- package/lib/browser/breakpoint/breakpoint-manager.d.ts +70 -70
- package/lib/browser/breakpoint/breakpoint-manager.js +328 -328
- package/lib/browser/breakpoint/breakpoint-marker.d.ts +41 -41
- package/lib/browser/breakpoint/breakpoint-marker.js +87 -87
- package/lib/browser/console/debug-console-contribution.d.ts +40 -40
- package/lib/browser/console/debug-console-contribution.js +231 -231
- package/lib/browser/console/debug-console-items.d.ts +93 -93
- package/lib/browser/console/debug-console-items.js +319 -319
- package/lib/browser/console/debug-console-session.d.ts +31 -31
- package/lib/browser/console/debug-console-session.js +199 -199
- package/lib/browser/debug-call-stack-item-type-key.d.ts +3 -3
- package/lib/browser/debug-call-stack-item-type-key.js +19 -19
- package/lib/browser/debug-configuration-manager.d.ts +102 -102
- package/lib/browser/debug-configuration-manager.js +552 -552
- package/lib/browser/debug-configuration-model.d.ts +29 -29
- package/lib/browser/debug-configuration-model.js +79 -79
- package/lib/browser/debug-contribution.d.ts +22 -22
- package/lib/browser/debug-contribution.js +19 -19
- package/lib/browser/debug-frontend-application-contribution.d.ts +222 -222
- package/lib/browser/debug-frontend-application-contribution.js +1404 -1404
- package/lib/browser/debug-frontend-module.d.ts +4 -4
- package/lib/browser/debug-frontend-module.d.ts.map +1 -1
- package/lib/browser/debug-frontend-module.js +105 -104
- package/lib/browser/debug-frontend-module.js.map +1 -1
- package/lib/browser/debug-package.spec.js +18 -18
- package/lib/browser/debug-preferences.d.ts +17 -17
- package/lib/browser/debug-preferences.js +89 -89
- package/lib/browser/debug-prefix-configuration.d.ts +51 -51
- package/lib/browser/debug-prefix-configuration.js +208 -208
- package/lib/browser/debug-resource.d.ts +14 -14
- package/lib/browser/debug-resource.js +65 -65
- package/lib/browser/debug-schema-updater.d.ts +15 -15
- package/lib/browser/debug-schema-updater.js +168 -168
- package/lib/browser/debug-session-connection.d.ts +110 -110
- package/lib/browser/debug-session-connection.js +258 -258
- package/lib/browser/debug-session-contribution.d.ts +73 -73
- package/lib/browser/debug-session-contribution.js +145 -145
- package/lib/browser/debug-session-manager.d.ts +137 -137
- package/lib/browser/debug-session-manager.js +599 -599
- package/lib/browser/debug-session-manager.js.map +1 -1
- package/lib/browser/debug-session-options.d.ts +48 -48
- package/lib/browser/debug-session-options.js +85 -85
- package/lib/browser/debug-session.d.ts +178 -178
- package/lib/browser/debug-session.js +871 -871
- package/lib/browser/debug-tab-bar-decorator.d.ts +16 -16
- package/lib/browser/debug-tab-bar-decorator.js +70 -70
- package/lib/browser/debug-watch-manager.d.ts +21 -21
- package/lib/browser/debug-watch-manager.js +93 -93
- package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.d.ts +6 -6
- package/lib/browser/disassembly-view/disassembly-view-accessibility-provider.js +38 -38
- package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.d.ts +19 -19
- package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.js +110 -110
- package/lib/browser/disassembly-view/disassembly-view-contribution.d.ts +24 -24
- package/lib/browser/disassembly-view/disassembly-view-contribution.js +131 -131
- package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.d.ts +38 -38
- package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.js +222 -222
- package/lib/browser/disassembly-view/disassembly-view-instruction-renderer.js.map +1 -1
- package/lib/browser/disassembly-view/disassembly-view-table-delegate.d.ts +15 -15
- package/lib/browser/disassembly-view/disassembly-view-table-delegate.js +38 -38
- package/lib/browser/disassembly-view/disassembly-view-utilities.d.ts +37 -37
- package/lib/browser/disassembly-view/disassembly-view-utilities.js +17 -17
- package/lib/browser/disassembly-view/disassembly-view-widget.d.ts +60 -60
- package/lib/browser/disassembly-view/disassembly-view-widget.js +453 -452
- package/lib/browser/disassembly-view/disassembly-view-widget.js.map +1 -1
- package/lib/browser/editor/debug-breakpoint-widget.d.ts +53 -53
- package/lib/browser/editor/debug-breakpoint-widget.js +261 -261
- package/lib/browser/editor/debug-editor-model.d.ts +91 -93
- package/lib/browser/editor/debug-editor-model.d.ts.map +1 -1
- package/lib/browser/editor/debug-editor-model.js +515 -516
- package/lib/browser/editor/debug-editor-model.js.map +1 -1
- package/lib/browser/editor/debug-editor-service.d.ts +35 -35
- package/lib/browser/editor/debug-editor-service.js +202 -202
- package/lib/browser/editor/debug-editor.d.ts +3 -3
- package/lib/browser/editor/debug-editor.js +19 -19
- package/lib/browser/editor/debug-exception-widget.d.ts +29 -29
- package/lib/browser/editor/debug-exception-widget.js +114 -114
- package/lib/browser/editor/debug-expression-provider.d.ts +11 -11
- package/lib/browser/editor/debug-expression-provider.js +81 -81
- package/lib/browser/editor/debug-hover-source.d.ts +18 -18
- package/lib/browser/editor/debug-hover-source.js +117 -117
- package/lib/browser/editor/debug-hover-widget.d.ts +47 -47
- package/lib/browser/editor/debug-hover-widget.js +276 -276
- package/lib/browser/editor/debug-inline-value-decorator.d.ts +19 -21
- package/lib/browser/editor/debug-inline-value-decorator.d.ts.map +1 -1
- package/lib/browser/editor/debug-inline-value-decorator.js +333 -337
- package/lib/browser/editor/debug-inline-value-decorator.js.map +1 -1
- package/lib/browser/model/debug-breakpoint.d.ts +47 -47
- package/lib/browser/model/debug-breakpoint.js +109 -109
- package/lib/browser/model/debug-function-breakpoint.d.ts +18 -18
- package/lib/browser/model/debug-function-breakpoint.js +92 -92
- package/lib/browser/model/debug-instruction-breakpoint.d.ts +14 -14
- package/lib/browser/model/debug-instruction-breakpoint.js +65 -65
- package/lib/browser/model/debug-source-breakpoint.d.ts +37 -37
- package/lib/browser/model/debug-source-breakpoint.js +217 -217
- package/lib/browser/model/debug-source.d.ts +24 -24
- package/lib/browser/model/debug-source.js +80 -80
- package/lib/browser/model/debug-stack-frame.d.ts +41 -41
- package/lib/browser/model/debug-stack-frame.js +150 -150
- package/lib/browser/model/debug-thread.d.ts +62 -62
- package/lib/browser/model/debug-thread.js +237 -237
- package/lib/browser/preferences/launch-preferences.d.ts +4 -4
- package/lib/browser/preferences/launch-preferences.js +38 -38
- package/lib/browser/view/debug-action.d.ts +16 -16
- package/lib/browser/view/debug-action.js +43 -43
- package/lib/browser/view/debug-breakpoints-source.d.ts +9 -9
- package/lib/browser/view/debug-breakpoints-source.js +70 -70
- package/lib/browser/view/debug-breakpoints-widget.d.ts +22 -22
- package/lib/browser/view/debug-breakpoints-widget.js +87 -87
- package/lib/browser/view/debug-configuration-select.d.ts +64 -64
- package/lib/browser/view/debug-configuration-select.js +216 -216
- package/lib/browser/view/debug-configuration-widget.d.ts +30 -30
- package/lib/browser/view/debug-configuration-widget.js +135 -135
- package/lib/browser/view/debug-exception-breakpoint.d.ts +14 -14
- package/lib/browser/view/debug-exception-breakpoint.js +61 -61
- package/lib/browser/view/debug-session-widget.d.ts +28 -28
- package/lib/browser/view/debug-session-widget.js +134 -134
- package/lib/browser/view/debug-stack-frames-source.d.ts +17 -17
- package/lib/browser/view/debug-stack-frames-source.js +89 -89
- package/lib/browser/view/debug-stack-frames-widget.d.ts +24 -24
- package/lib/browser/view/debug-stack-frames-widget.js +154 -154
- package/lib/browser/view/debug-threads-source.d.ts +8 -8
- package/lib/browser/view/debug-threads-source.js +63 -63
- package/lib/browser/view/debug-threads-widget.d.ts +26 -26
- package/lib/browser/view/debug-threads-widget.js +145 -145
- package/lib/browser/view/debug-toolbar-widget.d.ts +34 -34
- package/lib/browser/view/debug-toolbar-widget.js +156 -156
- package/lib/browser/view/debug-variables-source.d.ts +9 -9
- package/lib/browser/view/debug-variables-source.js +60 -60
- package/lib/browser/view/debug-variables-widget.d.ts +16 -16
- package/lib/browser/view/debug-variables-widget.js +78 -78
- package/lib/browser/view/debug-view-model.d.ts +51 -51
- package/lib/browser/view/debug-view-model.js +220 -220
- package/lib/browser/view/debug-watch-expression.d.ts +30 -30
- package/lib/browser/view/debug-watch-expression.js +73 -73
- package/lib/browser/view/debug-watch-source.d.ts +9 -9
- package/lib/browser/view/debug-watch-source.js +58 -58
- package/lib/browser/view/debug-watch-widget.d.ts +16 -16
- package/lib/browser/view/debug-watch-widget.js +78 -78
- package/lib/browser/view/debug-widget.d.ts +23 -23
- package/lib/browser/view/debug-widget.js +108 -108
- package/lib/common/debug-adapter-contribution-registry.d.ts +59 -59
- package/lib/common/debug-adapter-contribution-registry.js +212 -212
- package/lib/common/debug-adapter-session.d.ts +18 -18
- package/lib/common/debug-adapter-session.js +78 -78
- package/lib/common/debug-common.d.ts +1 -1
- package/lib/common/debug-common.js +29 -29
- package/lib/common/debug-compound.d.ts +14 -14
- package/lib/common/debug-compound.js +27 -27
- package/lib/common/debug-configuration.d.ts +70 -70
- package/lib/common/debug-configuration.js +31 -31
- package/lib/common/debug-model.d.ts +152 -152
- package/lib/common/debug-model.js +35 -35
- package/lib/common/debug-service.d.ts +123 -123
- package/lib/common/debug-service.js +66 -66
- package/lib/common/debug-uri-utils.d.ts +23 -23
- package/lib/common/debug-uri-utils.js +26 -26
- package/lib/common/inline-debug-adapter.d.ts +18 -18
- package/lib/common/inline-debug-adapter.js +44 -44
- package/lib/node/debug-adapter-factory.d.ts +19 -19
- package/lib/node/debug-adapter-factory.js +96 -96
- package/lib/node/debug-adapter-session-manager.d.ts +37 -37
- package/lib/node/debug-adapter-session-manager.js +111 -111
- package/lib/node/debug-backend-module.d.ts +3 -3
- package/lib/node/debug-backend-module.js +41 -41
- package/lib/node/debug-service-impl.d.ts +30 -30
- package/lib/node/debug-service-impl.js +124 -124
- package/lib/node/stream-debug-adapter.d.ts +36 -36
- package/lib/node/stream-debug-adapter.js +112 -112
- package/package.json +16 -16
- package/src/browser/breakpoint/breakpoint-manager.ts +369 -369
- package/src/browser/breakpoint/breakpoint-marker.ts +104 -104
- package/src/browser/console/debug-console-contribution.tsx +240 -240
- package/src/browser/console/debug-console-items.tsx +384 -384
- package/src/browser/console/debug-console-session.ts +205 -205
- package/src/browser/debug-call-stack-item-type-key.ts +20 -20
- package/src/browser/debug-configuration-manager.ts +591 -591
- package/src/browser/debug-configuration-model.ts +100 -100
- package/src/browser/debug-contribution.ts +43 -43
- package/src/browser/debug-frontend-application-contribution.ts +1551 -1551
- package/src/browser/debug-frontend-module.ts +133 -132
- package/src/browser/debug-package.spec.ts +20 -20
- package/src/browser/debug-preferences.ts +98 -98
- package/src/browser/debug-prefix-configuration.ts +195 -195
- package/src/browser/debug-resource.ts +59 -59
- package/src/browser/debug-schema-updater.ts +149 -149
- package/src/browser/debug-session-connection.ts +357 -357
- package/src/browser/debug-session-contribution.ts +150 -150
- package/src/browser/debug-session-manager.ts +682 -682
- package/src/browser/debug-session-options.ts +114 -114
- package/src/browser/debug-session.tsx +947 -947
- package/src/browser/debug-tab-bar-decorator.ts +57 -57
- package/src/browser/debug-watch-manager.ts +93 -93
- package/src/browser/disassembly-view/disassembly-view-accessibility-provider.ts +43 -43
- package/src/browser/disassembly-view/disassembly-view-breakpoint-renderer.ts +119 -119
- package/src/browser/disassembly-view/disassembly-view-contribution.ts +109 -109
- package/src/browser/disassembly-view/disassembly-view-instruction-renderer.ts +245 -245
- package/src/browser/disassembly-view/disassembly-view-table-delegate.ts +39 -39
- package/src/browser/disassembly-view/disassembly-view-utilities.ts +55 -55
- package/src/browser/disassembly-view/disassembly-view-widget.ts +463 -463
- package/src/browser/editor/debug-breakpoint-widget.tsx +293 -293
- package/src/browser/editor/debug-editor-model.ts +529 -528
- package/src/browser/editor/debug-editor-service.ts +192 -192
- package/src/browser/editor/debug-editor.ts +20 -20
- package/src/browser/editor/debug-exception-widget.tsx +122 -122
- package/src/browser/editor/debug-expression-provider.ts +78 -78
- package/src/browser/editor/debug-hover-source.tsx +105 -105
- package/src/browser/editor/debug-hover-widget.ts +298 -298
- package/src/browser/editor/debug-inline-value-decorator.ts +373 -377
- package/src/browser/model/debug-breakpoint.tsx +151 -151
- package/src/browser/model/debug-function-breakpoint.tsx +101 -101
- package/src/browser/model/debug-instruction-breakpoint.tsx +68 -68
- package/src/browser/model/debug-source-breakpoint.tsx +237 -237
- package/src/browser/model/debug-source.ts +93 -93
- package/src/browser/model/debug-stack-frame.tsx +170 -170
- package/src/browser/model/debug-thread.tsx +285 -285
- package/src/browser/preferences/launch-preferences.ts +38 -38
- package/src/browser/style/index.css +453 -453
- package/src/browser/view/debug-action.tsx +57 -57
- package/src/browser/view/debug-breakpoints-source.tsx +53 -53
- package/src/browser/view/debug-breakpoints-widget.ts +71 -71
- package/src/browser/view/debug-configuration-select.tsx +269 -269
- package/src/browser/view/debug-configuration-widget.tsx +121 -121
- package/src/browser/view/debug-exception-breakpoint.tsx +68 -68
- package/src/browser/view/debug-session-widget.ts +124 -124
- package/src/browser/view/debug-stack-frames-source.tsx +75 -75
- package/src/browser/view/debug-stack-frames-widget.ts +135 -135
- package/src/browser/view/debug-threads-source.tsx +48 -48
- package/src/browser/view/debug-threads-widget.ts +125 -125
- package/src/browser/view/debug-toolbar-widget.tsx +145 -145
- package/src/browser/view/debug-variables-source.ts +43 -43
- package/src/browser/view/debug-variables-widget.ts +61 -61
- package/src/browser/view/debug-view-model.ts +230 -230
- package/src/browser/view/debug-watch-expression.tsx +88 -88
- package/src/browser/view/debug-watch-source.ts +41 -41
- package/src/browser/view/debug-watch-widget.ts +61 -61
- package/src/browser/view/debug-widget.ts +97 -97
- package/src/common/debug-adapter-contribution-registry.ts +206 -206
- package/src/common/debug-adapter-session.ts +102 -102
- package/src/common/debug-common.ts +19 -19
- package/src/common/debug-compound.ts +33 -33
- package/src/common/debug-configuration.ts +108 -108
- package/src/common/debug-model.ts +200 -200
- package/src/common/debug-service.ts +184 -184
- package/src/common/debug-uri-utils.ts +24 -24
- package/src/common/inline-debug-adapter.ts +47 -47
- package/src/node/debug-adapter-factory.ts +107 -107
- package/src/node/debug-adapter-session-manager.ts +106 -106
- package/src/node/debug-backend-module.ts +57 -57
- package/src/node/debug-service-impl.ts +119 -119
- package/src/node/stream-debug-adapter.ts +126 -126
|
@@ -1,517 +1,516 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 TypeFox and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
var DebugEditorModel_1;
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.DebugEditorModel = exports.DebugEditorModelFactory = void 0;
|
|
29
|
-
const debounce = require("p-debounce");
|
|
30
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
31
|
-
const monaco = require("@theia/monaco-editor-core");
|
|
32
|
-
const configuration_1 = require("@theia/monaco-editor-core/esm/vs/platform/configuration/common/configuration");
|
|
33
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
34
|
-
const core_1 = require("@theia/core");
|
|
35
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
exports.DebugEditorModelFactory = Symbol('DebugEditorModelFactory');
|
|
46
|
-
let DebugEditorModel = DebugEditorModel_1 = class DebugEditorModel {
|
|
47
|
-
constructor() {
|
|
48
|
-
this.toDispose = new core_1.DisposableCollection();
|
|
49
|
-
this.toDisposeOnUpdate = new core_1.DisposableCollection();
|
|
50
|
-
this.breakpointDecorations = [];
|
|
51
|
-
this.breakpointRanges = new Map();
|
|
52
|
-
this.currentBreakpointDecorations = [];
|
|
53
|
-
this.editorDecorations = [];
|
|
54
|
-
this.updatingDecorations = false;
|
|
55
|
-
this.update = debounce(async () => {
|
|
56
|
-
if (this.toDispose.disposed) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
this.toDisposeOnUpdate.dispose();
|
|
60
|
-
this.toggleExceptionWidget();
|
|
61
|
-
await this.updateEditorDecorations();
|
|
62
|
-
this.updateEditorHover();
|
|
63
|
-
}, 100);
|
|
64
|
-
this.hintDecorations = [];
|
|
65
|
-
}
|
|
66
|
-
static createContainer(parent, editor) {
|
|
67
|
-
const child = (0, debug_hover_widget_1.createDebugHoverWidgetContainer)(parent, editor);
|
|
68
|
-
child.bind(DebugEditorModel_1).toSelf();
|
|
69
|
-
child.bind(debug_breakpoint_widget_1.DebugBreakpointWidget).toSelf();
|
|
70
|
-
child.bind(debug_exception_widget_1.DebugExceptionWidget).toSelf();
|
|
71
|
-
return child;
|
|
72
|
-
}
|
|
73
|
-
static createModel(parent, editor) {
|
|
74
|
-
return DebugEditorModel_1.createContainer(parent, editor).get(DebugEditorModel_1);
|
|
75
|
-
}
|
|
76
|
-
init() {
|
|
77
|
-
this.uri = new uri_1.default(this.editor.getControl().getModel().uri.toString());
|
|
78
|
-
this.toDispose.pushAll([
|
|
79
|
-
this.hover,
|
|
80
|
-
this.breakpointWidget,
|
|
81
|
-
this.exceptionWidget,
|
|
82
|
-
this.editor.getControl().onMouseDown(event => this.handleMouseDown(event)),
|
|
83
|
-
this.editor.getControl().onMouseMove(event => this.handleMouseMove(event)),
|
|
84
|
-
this.editor.getControl().onMouseLeave(event => this.handleMouseLeave(event)),
|
|
85
|
-
this.editor.getControl().onKeyDown(() => this.hover.hide({ immediate: false })),
|
|
86
|
-
this.editor.getControl().onDidChangeModelContent(() => this.update()),
|
|
87
|
-
this.editor.getControl().getModel().onDidChangeDecorations(() => this.updateBreakpoints()),
|
|
88
|
-
this.editor.onDidResize(e => this.breakpointWidget.inputSize = e),
|
|
89
|
-
this.sessions.onDidChange(() => this.update()),
|
|
90
|
-
this.toDisposeOnUpdate,
|
|
91
|
-
this.sessionManager.onDidChangeBreakpoints(({ session, uri }) => {
|
|
92
|
-
if ((!session || session === this.sessionManager.currentSession) && uri.isEqual(this.uri)) {
|
|
93
|
-
this.render();
|
|
94
|
-
}
|
|
95
|
-
}),
|
|
96
|
-
this.breakpoints.onDidChangeBreakpoints(event => this.closeBreakpointIfAffected(event)),
|
|
97
|
-
]);
|
|
98
|
-
this.update();
|
|
99
|
-
this.render();
|
|
100
|
-
}
|
|
101
|
-
dispose() {
|
|
102
|
-
this.toDispose.dispose();
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* To disable the default editor-contribution hover from Code when
|
|
106
|
-
* the editor has the `currentFrame`. Otherwise, both `textdocument/hover`
|
|
107
|
-
* and the debug hovers are visible at the same time when hovering over a symbol.
|
|
108
|
-
*/
|
|
109
|
-
async updateEditorHover() {
|
|
110
|
-
if (this.sessions.isCurrentEditorFrame(this.uri)) {
|
|
111
|
-
const codeEditor = this.editor.getControl();
|
|
112
|
-
codeEditor.updateOptions({ hover: { enabled: false } });
|
|
113
|
-
this.toDisposeOnUpdate.push(core_1.Disposable.create(() => {
|
|
114
|
-
const model = codeEditor.getModel();
|
|
115
|
-
const overrides = {
|
|
116
|
-
resource: model.uri,
|
|
117
|
-
overrideIdentifier: model.getLanguageId(),
|
|
118
|
-
};
|
|
119
|
-
const { enabled, delay, sticky } =
|
|
120
|
-
codeEditor.updateOptions({
|
|
121
|
-
hover: {
|
|
122
|
-
enabled,
|
|
123
|
-
delay,
|
|
124
|
-
sticky
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}));
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
async updateEditorDecorations() {
|
|
131
|
-
const [newFrameDecorations, inlineValueDecorations] = await Promise.all([
|
|
132
|
-
this.createFrameDecorations(),
|
|
133
|
-
this.createInlineValueDecorations()
|
|
134
|
-
]);
|
|
135
|
-
const codeEditor = this.editor.getControl();
|
|
136
|
-
codeEditor.removeDecorations([debug_inline_value_decorator_1.INLINE_VALUE_DECORATION_KEY]);
|
|
137
|
-
codeEditor.setDecorationsByType('Inline debug decorations', debug_inline_value_decorator_1.INLINE_VALUE_DECORATION_KEY, inlineValueDecorations);
|
|
138
|
-
this.editorDecorations = this.deltaDecorations(this.editorDecorations, newFrameDecorations);
|
|
139
|
-
}
|
|
140
|
-
async createInlineValueDecorations() {
|
|
141
|
-
if (!this.sessions.isCurrentEditorFrame(this.uri)) {
|
|
142
|
-
return [];
|
|
143
|
-
}
|
|
144
|
-
const { currentFrame } = this.sessions;
|
|
145
|
-
return this.inlineValueDecorator.calculateDecorations(this, currentFrame);
|
|
146
|
-
}
|
|
147
|
-
createFrameDecorations() {
|
|
148
|
-
const { currentFrame, topFrame } = this.sessions;
|
|
149
|
-
if (!currentFrame) {
|
|
150
|
-
return [];
|
|
151
|
-
}
|
|
152
|
-
if (!
|
|
153
|
-
return [];
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
if (!
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
this.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
this.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
const
|
|
296
|
-
const
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
return
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
return this.
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
return this.
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
return this.sessions.
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
this.
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
this.
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
this.
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
this.
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
this.
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
};
|
|
462
|
-
DebugEditorModel.
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
(
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
(
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
(
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
(
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
(
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
(
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
(
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
(
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
(
|
|
509
|
-
__metadata("design:
|
|
510
|
-
__metadata("design:
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
exports.DebugEditorModel = DebugEditorModel;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
var DebugEditorModel_1;
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.DebugEditorModel = exports.DebugEditorModelFactory = void 0;
|
|
29
|
+
const debounce = require("p-debounce");
|
|
30
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
31
|
+
const monaco = require("@theia/monaco-editor-core");
|
|
32
|
+
const configuration_1 = require("@theia/monaco-editor-core/esm/vs/platform/configuration/common/configuration");
|
|
33
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
34
|
+
const core_1 = require("@theia/core");
|
|
35
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
36
|
+
const breakpoint_manager_1 = require("../breakpoint/breakpoint-manager");
|
|
37
|
+
const debug_session_manager_1 = require("../debug-session-manager");
|
|
38
|
+
const breakpoint_marker_1 = require("../breakpoint/breakpoint-marker");
|
|
39
|
+
const debug_editor_1 = require("./debug-editor");
|
|
40
|
+
const debug_hover_widget_1 = require("./debug-hover-widget");
|
|
41
|
+
const debug_breakpoint_widget_1 = require("./debug-breakpoint-widget");
|
|
42
|
+
const debug_exception_widget_1 = require("./debug-exception-widget");
|
|
43
|
+
const debug_inline_value_decorator_1 = require("./debug-inline-value-decorator");
|
|
44
|
+
const standaloneServices_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices");
|
|
45
|
+
exports.DebugEditorModelFactory = Symbol('DebugEditorModelFactory');
|
|
46
|
+
let DebugEditorModel = DebugEditorModel_1 = class DebugEditorModel {
|
|
47
|
+
constructor() {
|
|
48
|
+
this.toDispose = new core_1.DisposableCollection();
|
|
49
|
+
this.toDisposeOnUpdate = new core_1.DisposableCollection();
|
|
50
|
+
this.breakpointDecorations = [];
|
|
51
|
+
this.breakpointRanges = new Map();
|
|
52
|
+
this.currentBreakpointDecorations = [];
|
|
53
|
+
this.editorDecorations = [];
|
|
54
|
+
this.updatingDecorations = false;
|
|
55
|
+
this.update = debounce(async () => {
|
|
56
|
+
if (this.toDispose.disposed) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.toDisposeOnUpdate.dispose();
|
|
60
|
+
this.toggleExceptionWidget();
|
|
61
|
+
await this.updateEditorDecorations();
|
|
62
|
+
this.updateEditorHover();
|
|
63
|
+
}, 100);
|
|
64
|
+
this.hintDecorations = [];
|
|
65
|
+
}
|
|
66
|
+
static createContainer(parent, editor) {
|
|
67
|
+
const child = (0, debug_hover_widget_1.createDebugHoverWidgetContainer)(parent, editor);
|
|
68
|
+
child.bind(DebugEditorModel_1).toSelf();
|
|
69
|
+
child.bind(debug_breakpoint_widget_1.DebugBreakpointWidget).toSelf();
|
|
70
|
+
child.bind(debug_exception_widget_1.DebugExceptionWidget).toSelf();
|
|
71
|
+
return child;
|
|
72
|
+
}
|
|
73
|
+
static createModel(parent, editor) {
|
|
74
|
+
return DebugEditorModel_1.createContainer(parent, editor).get(DebugEditorModel_1);
|
|
75
|
+
}
|
|
76
|
+
init() {
|
|
77
|
+
this.uri = new uri_1.default(this.editor.getControl().getModel().uri.toString());
|
|
78
|
+
this.toDispose.pushAll([
|
|
79
|
+
this.hover,
|
|
80
|
+
this.breakpointWidget,
|
|
81
|
+
this.exceptionWidget,
|
|
82
|
+
this.editor.getControl().onMouseDown(event => this.handleMouseDown(event)),
|
|
83
|
+
this.editor.getControl().onMouseMove(event => this.handleMouseMove(event)),
|
|
84
|
+
this.editor.getControl().onMouseLeave(event => this.handleMouseLeave(event)),
|
|
85
|
+
this.editor.getControl().onKeyDown(() => this.hover.hide({ immediate: false })),
|
|
86
|
+
this.editor.getControl().onDidChangeModelContent(() => this.update()),
|
|
87
|
+
this.editor.getControl().getModel().onDidChangeDecorations(() => this.updateBreakpoints()),
|
|
88
|
+
this.editor.onDidResize(e => this.breakpointWidget.inputSize = e),
|
|
89
|
+
this.sessions.onDidChange(() => this.update()),
|
|
90
|
+
this.toDisposeOnUpdate,
|
|
91
|
+
this.sessionManager.onDidChangeBreakpoints(({ session, uri }) => {
|
|
92
|
+
if ((!session || session === this.sessionManager.currentSession) && uri.isEqual(this.uri)) {
|
|
93
|
+
this.render();
|
|
94
|
+
}
|
|
95
|
+
}),
|
|
96
|
+
this.breakpoints.onDidChangeBreakpoints(event => this.closeBreakpointIfAffected(event)),
|
|
97
|
+
]);
|
|
98
|
+
this.update();
|
|
99
|
+
this.render();
|
|
100
|
+
}
|
|
101
|
+
dispose() {
|
|
102
|
+
this.toDispose.dispose();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* To disable the default editor-contribution hover from Code when
|
|
106
|
+
* the editor has the `currentFrame`. Otherwise, both `textdocument/hover`
|
|
107
|
+
* and the debug hovers are visible at the same time when hovering over a symbol.
|
|
108
|
+
*/
|
|
109
|
+
async updateEditorHover() {
|
|
110
|
+
if (this.sessions.isCurrentEditorFrame(this.uri)) {
|
|
111
|
+
const codeEditor = this.editor.getControl();
|
|
112
|
+
codeEditor.updateOptions({ hover: { enabled: false } });
|
|
113
|
+
this.toDisposeOnUpdate.push(core_1.Disposable.create(() => {
|
|
114
|
+
const model = codeEditor.getModel();
|
|
115
|
+
const overrides = {
|
|
116
|
+
resource: model.uri,
|
|
117
|
+
overrideIdentifier: model.getLanguageId(),
|
|
118
|
+
};
|
|
119
|
+
const { enabled, delay, sticky } = standaloneServices_1.StandaloneServices.get(configuration_1.IConfigurationService).getValue('editor.hover', overrides);
|
|
120
|
+
codeEditor.updateOptions({
|
|
121
|
+
hover: {
|
|
122
|
+
enabled,
|
|
123
|
+
delay,
|
|
124
|
+
sticky
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async updateEditorDecorations() {
|
|
131
|
+
const [newFrameDecorations, inlineValueDecorations] = await Promise.all([
|
|
132
|
+
this.createFrameDecorations(),
|
|
133
|
+
this.createInlineValueDecorations()
|
|
134
|
+
]);
|
|
135
|
+
const codeEditor = this.editor.getControl();
|
|
136
|
+
codeEditor.removeDecorations([debug_inline_value_decorator_1.INLINE_VALUE_DECORATION_KEY]);
|
|
137
|
+
codeEditor.setDecorationsByType('Inline debug decorations', debug_inline_value_decorator_1.INLINE_VALUE_DECORATION_KEY, inlineValueDecorations);
|
|
138
|
+
this.editorDecorations = this.deltaDecorations(this.editorDecorations, newFrameDecorations);
|
|
139
|
+
}
|
|
140
|
+
async createInlineValueDecorations() {
|
|
141
|
+
if (!this.sessions.isCurrentEditorFrame(this.uri)) {
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
const { currentFrame } = this.sessions;
|
|
145
|
+
return this.inlineValueDecorator.calculateDecorations(this, currentFrame);
|
|
146
|
+
}
|
|
147
|
+
createFrameDecorations() {
|
|
148
|
+
const { currentFrame, topFrame } = this.sessions;
|
|
149
|
+
if (!currentFrame) {
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
152
|
+
if (!currentFrame.thread.stopped) {
|
|
153
|
+
return [];
|
|
154
|
+
}
|
|
155
|
+
if (!this.sessions.isCurrentEditorFrame(this.uri)) {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
const decorations = [];
|
|
159
|
+
const columnUntilEOLRange = new monaco.Range(currentFrame.raw.line, currentFrame.raw.column, currentFrame.raw.line, 1 << 30);
|
|
160
|
+
const range = new monaco.Range(currentFrame.raw.line, currentFrame.raw.column, currentFrame.raw.line, currentFrame.raw.column + 1);
|
|
161
|
+
if (topFrame === currentFrame) {
|
|
162
|
+
decorations.push({
|
|
163
|
+
options: DebugEditorModel_1.TOP_STACK_FRAME_MARGIN,
|
|
164
|
+
range
|
|
165
|
+
});
|
|
166
|
+
decorations.push({
|
|
167
|
+
options: DebugEditorModel_1.TOP_STACK_FRAME_DECORATION,
|
|
168
|
+
range: columnUntilEOLRange
|
|
169
|
+
});
|
|
170
|
+
const { topFrameRange } = this;
|
|
171
|
+
if (topFrameRange && topFrameRange.startLineNumber === currentFrame.raw.line && topFrameRange.startColumn !== currentFrame.raw.column) {
|
|
172
|
+
decorations.push({
|
|
173
|
+
options: DebugEditorModel_1.TOP_STACK_FRAME_INLINE_DECORATION,
|
|
174
|
+
range: columnUntilEOLRange
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
this.topFrameRange = columnUntilEOLRange;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
decorations.push({
|
|
181
|
+
options: DebugEditorModel_1.FOCUSED_STACK_FRAME_MARGIN,
|
|
182
|
+
range
|
|
183
|
+
});
|
|
184
|
+
decorations.push({
|
|
185
|
+
options: DebugEditorModel_1.FOCUSED_STACK_FRAME_DECORATION,
|
|
186
|
+
range: columnUntilEOLRange
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return decorations;
|
|
190
|
+
}
|
|
191
|
+
async toggleExceptionWidget() {
|
|
192
|
+
const { currentFrame } = this.sessions;
|
|
193
|
+
if (!currentFrame) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (!this.sessions.isCurrentEditorFrame(this.uri)) {
|
|
197
|
+
this.exceptionWidget.hide();
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const info = await currentFrame.thread.getExceptionInfo();
|
|
201
|
+
if (!info) {
|
|
202
|
+
this.exceptionWidget.hide();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.exceptionWidget.show({
|
|
206
|
+
info,
|
|
207
|
+
lineNumber: currentFrame.raw.line,
|
|
208
|
+
column: currentFrame.raw.column
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
render() {
|
|
212
|
+
this.renderBreakpoints();
|
|
213
|
+
this.renderCurrentBreakpoints();
|
|
214
|
+
}
|
|
215
|
+
renderBreakpoints() {
|
|
216
|
+
const breakpoints = this.breakpoints.getBreakpoints(this.uri);
|
|
217
|
+
const decorations = this.createBreakpointDecorations(breakpoints);
|
|
218
|
+
this.breakpointDecorations = this.deltaDecorations(this.breakpointDecorations, decorations);
|
|
219
|
+
this.updateBreakpointRanges(breakpoints);
|
|
220
|
+
}
|
|
221
|
+
createBreakpointDecorations(breakpoints) {
|
|
222
|
+
return breakpoints.map(breakpoint => this.createBreakpointDecoration(breakpoint));
|
|
223
|
+
}
|
|
224
|
+
createBreakpointDecoration(breakpoint) {
|
|
225
|
+
const lineNumber = breakpoint.raw.line;
|
|
226
|
+
const column = breakpoint.raw.column;
|
|
227
|
+
const range = typeof column === 'number' ? new monaco.Range(lineNumber, column, lineNumber, column + 1) : new monaco.Range(lineNumber, 1, lineNumber, 2);
|
|
228
|
+
return {
|
|
229
|
+
range,
|
|
230
|
+
options: {
|
|
231
|
+
stickiness: DebugEditorModel_1.STICKINESS
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
updateBreakpointRanges(breakpoints) {
|
|
236
|
+
this.breakpointRanges.clear();
|
|
237
|
+
for (let i = 0; i < this.breakpointDecorations.length; i++) {
|
|
238
|
+
const decoration = this.breakpointDecorations[i];
|
|
239
|
+
const breakpoint = breakpoints[i];
|
|
240
|
+
const range = this.editor.getControl().getModel().getDecorationRange(decoration);
|
|
241
|
+
this.breakpointRanges.set(decoration, [range, breakpoint]);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
renderCurrentBreakpoints() {
|
|
245
|
+
const decorations = this.createCurrentBreakpointDecorations();
|
|
246
|
+
this.currentBreakpointDecorations = this.deltaDecorations(this.currentBreakpointDecorations, decorations);
|
|
247
|
+
}
|
|
248
|
+
createCurrentBreakpointDecorations() {
|
|
249
|
+
const breakpoints = this.sessions.getBreakpoints(this.uri);
|
|
250
|
+
return breakpoints.map(breakpoint => this.createCurrentBreakpointDecoration(breakpoint));
|
|
251
|
+
}
|
|
252
|
+
createCurrentBreakpointDecoration(breakpoint) {
|
|
253
|
+
const lineNumber = breakpoint.line;
|
|
254
|
+
const column = breakpoint.column;
|
|
255
|
+
const range = typeof column === 'number' ? new monaco.Range(lineNumber, column, lineNumber, column + 1) : new monaco.Range(lineNumber, 1, lineNumber, 1);
|
|
256
|
+
const { className, message } = breakpoint.getDecoration();
|
|
257
|
+
const renderInline = typeof column === 'number' && (column > this.editor.getControl().getModel().getLineFirstNonWhitespaceColumn(lineNumber));
|
|
258
|
+
return {
|
|
259
|
+
range,
|
|
260
|
+
options: {
|
|
261
|
+
glyphMarginClassName: className,
|
|
262
|
+
glyphMarginHoverMessage: message.map(value => ({ value })),
|
|
263
|
+
stickiness: DebugEditorModel_1.STICKINESS,
|
|
264
|
+
beforeContentClassName: renderInline ? `theia-debug-breakpoint-column codicon ${className}` : undefined
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
updateBreakpoints() {
|
|
269
|
+
if (this.areBreakpointsAffected()) {
|
|
270
|
+
const breakpoints = this.createBreakpoints();
|
|
271
|
+
this.breakpoints.setBreakpoints(this.uri, breakpoints);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
areBreakpointsAffected() {
|
|
275
|
+
if (this.updatingDecorations || !this.editor.getControl().getModel()) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
for (const decoration of this.breakpointDecorations) {
|
|
279
|
+
const range = this.editor.getControl().getModel().getDecorationRange(decoration);
|
|
280
|
+
const oldRange = this.breakpointRanges.get(decoration)[0];
|
|
281
|
+
if (!range || !range.equalsRange(oldRange)) {
|
|
282
|
+
return true;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
createBreakpoints() {
|
|
288
|
+
var _a;
|
|
289
|
+
const { uri } = this;
|
|
290
|
+
const lines = new Set();
|
|
291
|
+
const breakpoints = [];
|
|
292
|
+
for (const decoration of this.breakpointDecorations) {
|
|
293
|
+
const range = this.editor.getControl().getModel().getDecorationRange(decoration);
|
|
294
|
+
if (range && !lines.has(range.startLineNumber)) {
|
|
295
|
+
const line = range.startLineNumber;
|
|
296
|
+
const column = range.startColumn;
|
|
297
|
+
const oldBreakpoint = (_a = this.breakpointRanges.get(decoration)) === null || _a === void 0 ? void 0 : _a[1];
|
|
298
|
+
const isLineBreakpoint = (oldBreakpoint === null || oldBreakpoint === void 0 ? void 0 : oldBreakpoint.raw.line) !== undefined && (oldBreakpoint === null || oldBreakpoint === void 0 ? void 0 : oldBreakpoint.raw.column) === undefined;
|
|
299
|
+
const change = isLineBreakpoint ? { line } : { line, column };
|
|
300
|
+
const breakpoint = breakpoint_marker_1.SourceBreakpoint.create(uri, change, oldBreakpoint);
|
|
301
|
+
breakpoints.push(breakpoint);
|
|
302
|
+
lines.add(line);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return breakpoints;
|
|
306
|
+
}
|
|
307
|
+
get position() {
|
|
308
|
+
return this.editor.getControl().getPosition();
|
|
309
|
+
}
|
|
310
|
+
getBreakpoint(position = this.position) {
|
|
311
|
+
return this.getInlineBreakpoint(position) || this.getLineBreakpoints(position)[0];
|
|
312
|
+
}
|
|
313
|
+
getInlineBreakpoint(position = this.position) {
|
|
314
|
+
return this.sessions.getInlineBreakpoint(this.uri, position.lineNumber, position.column);
|
|
315
|
+
}
|
|
316
|
+
getLineBreakpoints(position = this.position) {
|
|
317
|
+
return this.sessions.getLineBreakpoints(this.uri, position.lineNumber);
|
|
318
|
+
}
|
|
319
|
+
addBreakpoint(raw) {
|
|
320
|
+
this.breakpoints.addBreakpoint(breakpoint_marker_1.SourceBreakpoint.create(this.uri, raw));
|
|
321
|
+
}
|
|
322
|
+
toggleBreakpoint(position = this.position) {
|
|
323
|
+
const { lineNumber } = position;
|
|
324
|
+
const breakpoints = this.getLineBreakpoints(position);
|
|
325
|
+
if (breakpoints.length) {
|
|
326
|
+
for (const breakpoint of breakpoints) {
|
|
327
|
+
breakpoint.remove();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
this.addBreakpoint({ line: lineNumber });
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
addInlineBreakpoint() {
|
|
335
|
+
const { position } = this;
|
|
336
|
+
const { lineNumber, column } = position;
|
|
337
|
+
const breakpoint = this.getInlineBreakpoint(position);
|
|
338
|
+
if (breakpoint) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
this.addBreakpoint({ line: lineNumber, column });
|
|
342
|
+
}
|
|
343
|
+
acceptBreakpoint() {
|
|
344
|
+
const { position, values } = this.breakpointWidget;
|
|
345
|
+
if (position && values) {
|
|
346
|
+
const breakpoint = position.column > 0 ? this.getInlineBreakpoint(position) : this.getLineBreakpoints(position)[0];
|
|
347
|
+
if (breakpoint) {
|
|
348
|
+
breakpoint.updateOrigins(values);
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
const { lineNumber } = position;
|
|
352
|
+
const column = position.column > 0 ? position.column : undefined;
|
|
353
|
+
this.addBreakpoint({ line: lineNumber, column, ...values });
|
|
354
|
+
}
|
|
355
|
+
this.breakpointWidget.hide();
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
handleMouseDown(event) {
|
|
359
|
+
if (event.target && event.target.type === monaco.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
|
|
360
|
+
if (!event.event.rightButton) {
|
|
361
|
+
this.toggleBreakpoint(event.target.position);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
this.hintBreakpoint(event);
|
|
365
|
+
}
|
|
366
|
+
handleMouseMove(event) {
|
|
367
|
+
this.showHover(event);
|
|
368
|
+
this.hintBreakpoint(event);
|
|
369
|
+
}
|
|
370
|
+
handleMouseLeave(event) {
|
|
371
|
+
this.hideHover(event);
|
|
372
|
+
this.deltaHintDecorations([]);
|
|
373
|
+
}
|
|
374
|
+
hintBreakpoint(event) {
|
|
375
|
+
const hintDecorations = this.createHintDecorations(event);
|
|
376
|
+
this.deltaHintDecorations(hintDecorations);
|
|
377
|
+
}
|
|
378
|
+
deltaHintDecorations(hintDecorations) {
|
|
379
|
+
this.hintDecorations = this.deltaDecorations(this.hintDecorations, hintDecorations);
|
|
380
|
+
}
|
|
381
|
+
createHintDecorations(event) {
|
|
382
|
+
if (event.target && event.target.type === monaco.editor.MouseTargetType.GUTTER_GLYPH_MARGIN && event.target.position) {
|
|
383
|
+
const lineNumber = event.target.position.lineNumber;
|
|
384
|
+
if (this.getLineBreakpoints(event.target.position).length) {
|
|
385
|
+
return [];
|
|
386
|
+
}
|
|
387
|
+
return [{
|
|
388
|
+
range: new monaco.Range(lineNumber, 1, lineNumber, 1),
|
|
389
|
+
options: DebugEditorModel_1.BREAKPOINT_HINT_DECORATION
|
|
390
|
+
}];
|
|
391
|
+
}
|
|
392
|
+
return [];
|
|
393
|
+
}
|
|
394
|
+
closeBreakpointIfAffected({ uri, removed }) {
|
|
395
|
+
if (!uri.isEqual(this.uri)) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
const position = this.breakpointWidget.position;
|
|
399
|
+
if (!position) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
for (const breakpoint of removed) {
|
|
403
|
+
if (breakpoint.raw.line === position.lineNumber) {
|
|
404
|
+
this.breakpointWidget.hide();
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
showHover(mouseEvent) {
|
|
410
|
+
const targetType = mouseEvent.target.type;
|
|
411
|
+
const stopKey = core_1.isOSX ? 'metaKey' : 'ctrlKey';
|
|
412
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
413
|
+
if (targetType === monaco.editor.MouseTargetType.CONTENT_WIDGET && mouseEvent.target.detail === this.hover.getId() && !mouseEvent.event[stopKey]) {
|
|
414
|
+
// mouse moved on top of debug hover widget
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
if (targetType === monaco.editor.MouseTargetType.CONTENT_TEXT) {
|
|
418
|
+
this.hover.show({
|
|
419
|
+
selection: mouseEvent.target.range,
|
|
420
|
+
immediate: false
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
else {
|
|
424
|
+
this.hover.hide({ immediate: false });
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
hideHover({ event }) {
|
|
428
|
+
const rect = this.hover.getDomNode().getBoundingClientRect();
|
|
429
|
+
if (event.posx < rect.left || event.posx > rect.right || event.posy < rect.top || event.posy > rect.bottom) {
|
|
430
|
+
this.hover.hide({ immediate: false });
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
deltaDecorations(oldDecorations, newDecorations) {
|
|
434
|
+
this.updatingDecorations = true;
|
|
435
|
+
try {
|
|
436
|
+
return this.editor.getControl().deltaDecorations(oldDecorations, newDecorations);
|
|
437
|
+
}
|
|
438
|
+
finally {
|
|
439
|
+
this.updatingDecorations = false;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
DebugEditorModel.CONTEXT_MENU = ['debug-editor-context-menu'];
|
|
444
|
+
DebugEditorModel.STICKINESS = monaco.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges;
|
|
445
|
+
DebugEditorModel.BREAKPOINT_HINT_DECORATION = {
|
|
446
|
+
glyphMarginClassName: 'codicon-debug-hint',
|
|
447
|
+
stickiness: DebugEditorModel_1.STICKINESS
|
|
448
|
+
};
|
|
449
|
+
DebugEditorModel.TOP_STACK_FRAME_MARGIN = {
|
|
450
|
+
glyphMarginClassName: 'codicon-debug-stackframe',
|
|
451
|
+
stickiness: DebugEditorModel_1.STICKINESS
|
|
452
|
+
};
|
|
453
|
+
DebugEditorModel.FOCUSED_STACK_FRAME_MARGIN = {
|
|
454
|
+
glyphMarginClassName: 'codicon-debug-stackframe-focused',
|
|
455
|
+
stickiness: DebugEditorModel_1.STICKINESS
|
|
456
|
+
};
|
|
457
|
+
DebugEditorModel.TOP_STACK_FRAME_DECORATION = {
|
|
458
|
+
isWholeLine: true,
|
|
459
|
+
className: 'theia-debug-top-stack-frame-line',
|
|
460
|
+
stickiness: DebugEditorModel_1.STICKINESS
|
|
461
|
+
};
|
|
462
|
+
DebugEditorModel.TOP_STACK_FRAME_INLINE_DECORATION = {
|
|
463
|
+
beforeContentClassName: 'theia-debug-top-stack-frame-column'
|
|
464
|
+
};
|
|
465
|
+
DebugEditorModel.FOCUSED_STACK_FRAME_DECORATION = {
|
|
466
|
+
isWholeLine: true,
|
|
467
|
+
className: 'theia-debug-focused-stack-frame-line',
|
|
468
|
+
stickiness: DebugEditorModel_1.STICKINESS
|
|
469
|
+
};
|
|
470
|
+
__decorate([
|
|
471
|
+
(0, inversify_1.inject)(debug_hover_widget_1.DebugHoverWidget),
|
|
472
|
+
__metadata("design:type", debug_hover_widget_1.DebugHoverWidget)
|
|
473
|
+
], DebugEditorModel.prototype, "hover", void 0);
|
|
474
|
+
__decorate([
|
|
475
|
+
(0, inversify_1.inject)(debug_editor_1.DebugEditor),
|
|
476
|
+
__metadata("design:type", Object)
|
|
477
|
+
], DebugEditorModel.prototype, "editor", void 0);
|
|
478
|
+
__decorate([
|
|
479
|
+
(0, inversify_1.inject)(breakpoint_manager_1.BreakpointManager),
|
|
480
|
+
__metadata("design:type", breakpoint_manager_1.BreakpointManager)
|
|
481
|
+
], DebugEditorModel.prototype, "breakpoints", void 0);
|
|
482
|
+
__decorate([
|
|
483
|
+
(0, inversify_1.inject)(debug_session_manager_1.DebugSessionManager),
|
|
484
|
+
__metadata("design:type", debug_session_manager_1.DebugSessionManager)
|
|
485
|
+
], DebugEditorModel.prototype, "sessions", void 0);
|
|
486
|
+
__decorate([
|
|
487
|
+
(0, inversify_1.inject)(browser_1.ContextMenuRenderer),
|
|
488
|
+
__metadata("design:type", browser_1.ContextMenuRenderer)
|
|
489
|
+
], DebugEditorModel.prototype, "contextMenu", void 0);
|
|
490
|
+
__decorate([
|
|
491
|
+
(0, inversify_1.inject)(debug_breakpoint_widget_1.DebugBreakpointWidget),
|
|
492
|
+
__metadata("design:type", debug_breakpoint_widget_1.DebugBreakpointWidget)
|
|
493
|
+
], DebugEditorModel.prototype, "breakpointWidget", void 0);
|
|
494
|
+
__decorate([
|
|
495
|
+
(0, inversify_1.inject)(debug_exception_widget_1.DebugExceptionWidget),
|
|
496
|
+
__metadata("design:type", debug_exception_widget_1.DebugExceptionWidget)
|
|
497
|
+
], DebugEditorModel.prototype, "exceptionWidget", void 0);
|
|
498
|
+
__decorate([
|
|
499
|
+
(0, inversify_1.inject)(debug_inline_value_decorator_1.DebugInlineValueDecorator),
|
|
500
|
+
__metadata("design:type", debug_inline_value_decorator_1.DebugInlineValueDecorator)
|
|
501
|
+
], DebugEditorModel.prototype, "inlineValueDecorator", void 0);
|
|
502
|
+
__decorate([
|
|
503
|
+
(0, inversify_1.inject)(debug_session_manager_1.DebugSessionManager),
|
|
504
|
+
__metadata("design:type", debug_session_manager_1.DebugSessionManager)
|
|
505
|
+
], DebugEditorModel.prototype, "sessionManager", void 0);
|
|
506
|
+
__decorate([
|
|
507
|
+
(0, inversify_1.postConstruct)(),
|
|
508
|
+
__metadata("design:type", Function),
|
|
509
|
+
__metadata("design:paramtypes", []),
|
|
510
|
+
__metadata("design:returntype", void 0)
|
|
511
|
+
], DebugEditorModel.prototype, "init", null);
|
|
512
|
+
DebugEditorModel = DebugEditorModel_1 = __decorate([
|
|
513
|
+
(0, inversify_1.injectable)()
|
|
514
|
+
], DebugEditorModel);
|
|
515
|
+
exports.DebugEditorModel = DebugEditorModel;
|
|
517
516
|
//# sourceMappingURL=debug-editor-model.js.map
|