@theia/debug 1.17.0-next.ff9e0507 → 1.18.0-next.04e2816d
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/breakpoint/breakpoint-manager.js +159 -382
- package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
- package/lib/browser/breakpoint/breakpoint-marker.js +4 -15
- package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -1
- package/lib/browser/console/debug-console-contribution.d.ts.map +1 -1
- package/lib/browser/console/debug-console-contribution.js +132 -221
- package/lib/browser/console/debug-console-contribution.js.map +1 -1
- package/lib/browser/console/debug-console-items.js +231 -451
- package/lib/browser/console/debug-console-items.js.map +1 -1
- package/lib/browser/console/debug-console-session.js +86 -223
- package/lib/browser/console/debug-console-session.js.map +1 -1
- package/lib/browser/debug-configuration-manager.js +281 -623
- package/lib/browser/debug-configuration-manager.js.map +1 -1
- package/lib/browser/debug-configuration-model.js +31 -108
- package/lib/browser/debug-configuration-model.js.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.d.ts +1 -0
- package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.js +577 -780
- package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
- package/lib/browser/debug-frontend-module.js +46 -82
- package/lib/browser/debug-frontend-module.js.map +1 -1
- package/lib/browser/debug-keybinding-contexts.js +41 -59
- package/lib/browser/debug-keybinding-contexts.js.map +1 -1
- package/lib/browser/debug-monaco-contribution.js +17 -17
- package/lib/browser/debug-monaco-contribution.js.map +1 -1
- package/lib/browser/debug-package.spec.js +2 -2
- package/lib/browser/debug-package.spec.js.map +1 -1
- package/lib/browser/debug-preferences.js +7 -11
- package/lib/browser/debug-preferences.js.map +1 -1
- package/lib/browser/debug-prefix-configuration.js +101 -117
- package/lib/browser/debug-prefix-configuration.js.map +1 -1
- package/lib/browser/debug-resource.js +29 -79
- package/lib/browser/debug-resource.js.map +1 -1
- package/lib/browser/debug-schema-updater.js +54 -193
- package/lib/browser/debug-schema-updater.js.map +1 -1
- package/lib/browser/debug-session-connection.js +137 -235
- package/lib/browser/debug-session-connection.js.map +1 -1
- package/lib/browser/debug-session-contribution.js +91 -120
- package/lib/browser/debug-session-contribution.js.map +1 -1
- package/lib/browser/debug-session-manager.js +368 -652
- package/lib/browser/debug-session-manager.js.map +1 -1
- package/lib/browser/debug-session.js +556 -1279
- package/lib/browser/debug-session.js.map +1 -1
- package/lib/browser/debug-tab-bar-decorator.js +32 -38
- package/lib/browser/debug-tab-bar-decorator.js.map +1 -1
- package/lib/browser/debug-watch-manager.js +41 -138
- package/lib/browser/debug-watch-manager.js.map +1 -1
- package/lib/browser/editor/debug-breakpoint-widget.js +142 -255
- package/lib/browser/editor/debug-breakpoint-widget.js.map +1 -1
- package/lib/browser/editor/debug-editor-model.js +299 -474
- package/lib/browser/editor/debug-editor-model.js.map +1 -1
- package/lib/browser/editor/debug-editor-service.js +128 -206
- package/lib/browser/editor/debug-editor-service.js.map +1 -1
- package/lib/browser/editor/debug-exception-widget.js +56 -119
- package/lib/browser/editor/debug-exception-widget.js.map +1 -1
- package/lib/browser/editor/debug-expression-provider.js +21 -24
- package/lib/browser/editor/debug-expression-provider.js.map +1 -1
- package/lib/browser/editor/debug-hover-source.js +83 -249
- package/lib/browser/editor/debug-hover-source.js.map +1 -1
- package/lib/browser/editor/debug-hover-widget.js +151 -224
- package/lib/browser/editor/debug-hover-widget.js.map +1 -1
- package/lib/browser/editor/debug-inline-value-decorator.js +96 -193
- package/lib/browser/editor/debug-inline-value-decorator.js.map +1 -1
- package/lib/browser/model/debug-breakpoint.js +52 -102
- package/lib/browser/model/debug-breakpoint.js.map +1 -1
- package/lib/browser/model/debug-function-breakpoint.js +54 -124
- package/lib/browser/model/debug-function-breakpoint.js.map +1 -1
- package/lib/browser/model/debug-source-breakpoint.js +111 -265
- package/lib/browser/model/debug-source-breakpoint.js.map +1 -1
- package/lib/browser/model/debug-source.js +45 -126
- package/lib/browser/model/debug-source.js.map +1 -1
- package/lib/browser/model/debug-stack-frame.js +85 -199
- package/lib/browser/model/debug-stack-frame.js.map +1 -1
- package/lib/browser/model/debug-thread.js +132 -304
- package/lib/browser/model/debug-thread.js.map +1 -1
- package/lib/browser/preferences/launch-preferences.js +3 -3
- package/lib/browser/preferences/launch-preferences.js.map +1 -1
- package/lib/browser/view/debug-action.js +13 -29
- package/lib/browser/view/debug-action.js.map +1 -1
- package/lib/browser/view/debug-breakpoints-source.js +42 -169
- package/lib/browser/view/debug-breakpoints-source.js.map +1 -1
- package/lib/browser/view/debug-breakpoints-widget.js +43 -82
- package/lib/browser/view/debug-breakpoints-widget.js.map +1 -1
- package/lib/browser/view/debug-configuration-widget.js +89 -136
- package/lib/browser/view/debug-configuration-widget.js.map +1 -1
- package/lib/browser/view/debug-exception-breakpoint.js +7 -9
- package/lib/browser/view/debug-exception-breakpoint.js.map +1 -1
- package/lib/browser/view/debug-session-widget.js +80 -114
- package/lib/browser/view/debug-session-widget.js.map +1 -1
- package/lib/browser/view/debug-stack-frames-source.js +58 -169
- package/lib/browser/view/debug-stack-frames-source.js.map +1 -1
- package/lib/browser/view/debug-stack-frames-widget.js +89 -155
- package/lib/browser/view/debug-stack-frames-widget.js.map +1 -1
- package/lib/browser/view/debug-threads-source.js +37 -124
- package/lib/browser/view/debug-threads-source.js.map +1 -1
- package/lib/browser/view/debug-threads-widget.js +61 -99
- package/lib/browser/view/debug-threads-widget.js.map +1 -1
- package/lib/browser/view/debug-toolbar-widget.js +58 -76
- package/lib/browser/view/debug-toolbar-widget.js.map +1 -1
- package/lib/browser/view/debug-variables-source.js +32 -102
- package/lib/browser/view/debug-variables-source.js.map +1 -1
- package/lib/browser/view/debug-variables-widget.js +35 -74
- package/lib/browser/view/debug-variables-widget.js.map +1 -1
- package/lib/browser/view/debug-view-model.js +172 -381
- package/lib/browser/view/debug-view-model.js.map +1 -1
- package/lib/browser/view/debug-watch-expression.js +34 -112
- package/lib/browser/view/debug-watch-expression.js.map +1 -1
- package/lib/browser/view/debug-watch-source.js +30 -87
- package/lib/browser/view/debug-watch-source.js.map +1 -1
- package/lib/browser/view/debug-watch-widget.js +35 -74
- package/lib/browser/view/debug-watch-widget.js.map +1 -1
- package/lib/browser/view/debug-widget.js +63 -105
- package/lib/browser/view/debug-widget.js.map +1 -1
- package/lib/common/debug-service.js +5 -5
- package/lib/common/debug-service.js.map +1 -1
- package/lib/node/debug-adapter-contribution-registry.js +133 -489
- package/lib/node/debug-adapter-contribution-registry.js.map +1 -1
- package/lib/node/debug-adapter-factory.js +38 -57
- package/lib/node/debug-adapter-factory.js.map +1 -1
- package/lib/node/debug-adapter-session-manager.js +50 -98
- package/lib/node/debug-adapter-session-manager.js.map +1 -1
- package/lib/node/debug-adapter-session.js +44 -93
- package/lib/node/debug-adapter-session.js.map +1 -1
- package/lib/node/debug-backend-module.js +13 -17
- package/lib/node/debug-backend-module.js.map +1 -1
- package/lib/node/debug-service-impl.js +71 -213
- package/lib/node/debug-service-impl.js.map +1 -1
- package/lib/node/vscode/vscode-debug-adapter-contribution.js +153 -294
- package/lib/node/vscode/vscode-debug-adapter-contribution.js.map +1 -1
- package/package.json +16 -16
- package/src/browser/console/debug-console-contribution.tsx +3 -3
- package/src/browser/debug-frontend-application-contribution.ts +69 -18
- package/src/browser/debug-prefix-configuration.ts +1 -1
- package/src/browser/style/index.css +28 -10
- package/src/browser/view/debug-action.tsx +2 -2
- package/src/browser/view/debug-configuration-widget.tsx +3 -3
- package/src/browser/view/debug-session-widget.ts +2 -2
- package/src/browser/view/debug-toolbar-widget.tsx +8 -8
- package/src/browser/view/debug-widget.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-exception-widget.js","sourceRoot":"","sources":["../../../src/browser/editor/debug-exception-widget.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF
|
|
1
|
+
{"version":3,"file":"debug-exception-widget.js","sourceRoot":"","sources":["../../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C,CAAC,2BAA2B,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAO;YACxG,IAAI,CAAC,WAAW,IAAI,6BAAK,SAAS,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAO;YACzE,UAAU,IAAI,6BAAK,SAAS,EAAC,aAAa,IAAE,UAAU,CAAO,CACjD,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAES,MAAM;QACZ,0CAA0C;QAC1C,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;QAEjD,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC7F,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,GAAG,UAAU,CAAC,CAAC;QACnF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IACpC,CAAC;CAEJ,CAAA;AAxDG;IADC,kBAAM,CAAC,0BAAW,CAAC;;oDACS;AAO7B;IADC,yBAAa,EAAE;;;;gDAMf;AAfQ,oBAAoB;IADhC,sBAAU,EAAE;GACA,oBAAoB,CA2DhC;AA3DY,oDAAoB"}
|
|
@@ -26,30 +26,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
exports.DebugExpressionProvider = void 0;
|
|
29
|
-
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
30
|
/**
|
|
31
31
|
* TODO: introduce a new request to LSP to look up an expression range: https://github.com/Microsoft/language-server-protocol/issues/462
|
|
32
32
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var lineContent = model.getLineContent(selection.startLineNumber);
|
|
38
|
-
var _a = this.getExactExpressionStartAndEnd(lineContent, selection.startColumn, selection.endColumn), start = _a.start, end = _a.end;
|
|
33
|
+
let DebugExpressionProvider = class DebugExpressionProvider {
|
|
34
|
+
get(model, selection) {
|
|
35
|
+
const lineContent = model.getLineContent(selection.startLineNumber);
|
|
36
|
+
const { start, end } = this.getExactExpressionStartAndEnd(lineContent, selection.startColumn, selection.endColumn);
|
|
39
37
|
return lineContent.substring(start - 1, end);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
}
|
|
39
|
+
getExactExpressionStartAndEnd(lineContent, looseStart, looseEnd) {
|
|
40
|
+
let matchingExpression = undefined;
|
|
41
|
+
let startOffset = 0;
|
|
44
42
|
// Some example supported expressions: myVar.prop, a.b.c.d, myVar?.prop, myVar->prop, MyClass::StaticProp, *myVar
|
|
45
43
|
// Match any character except a set of characters which often break interesting sub-expressions
|
|
46
|
-
|
|
44
|
+
const expression = /([^()\[\]{}<>\s+\-/%~#^;=|,`!]|\->)+/g;
|
|
47
45
|
// eslint-disable-next-line no-null/no-null
|
|
48
|
-
|
|
46
|
+
let result = null;
|
|
49
47
|
// First find the full expression under the cursor
|
|
50
48
|
while (result = expression.exec(lineContent)) {
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
const start = result.index + 1;
|
|
50
|
+
const end = start + result[0].length;
|
|
53
51
|
if (start <= looseStart && end >= looseEnd) {
|
|
54
52
|
matchingExpression = result[0];
|
|
55
53
|
startOffset = start;
|
|
@@ -59,11 +57,11 @@ var DebugExpressionProvider = /** @class */ (function () {
|
|
|
59
57
|
// If there are non-word characters after the cursor, we want to truncate the expression then.
|
|
60
58
|
// For example in expression 'a.b.c.d', if the focus was under 'b', 'a.b' would be evaluated.
|
|
61
59
|
if (matchingExpression) {
|
|
62
|
-
|
|
60
|
+
const subExpression = /\w+/g;
|
|
63
61
|
// eslint-disable-next-line no-null/no-null
|
|
64
|
-
|
|
62
|
+
let subExpressionResult = null;
|
|
65
63
|
while (subExpressionResult = subExpression.exec(matchingExpression)) {
|
|
66
|
-
|
|
64
|
+
const subEnd = subExpressionResult.index + 1 + startOffset + subExpressionResult[0].length;
|
|
67
65
|
if (subEnd >= looseEnd) {
|
|
68
66
|
break;
|
|
69
67
|
}
|
|
@@ -75,11 +73,10 @@ var DebugExpressionProvider = /** @class */ (function () {
|
|
|
75
73
|
return matchingExpression ?
|
|
76
74
|
{ start: startOffset, end: startOffset + matchingExpression.length - 1 } :
|
|
77
75
|
{ start: 0, end: 0 };
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}());
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
DebugExpressionProvider = __decorate([
|
|
79
|
+
inversify_1.injectable()
|
|
80
|
+
], DebugExpressionProvider);
|
|
84
81
|
exports.DebugExpressionProvider = DebugExpressionProvider;
|
|
85
82
|
//# sourceMappingURL=debug-expression-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-expression-provider.js","sourceRoot":"","sources":["../../../src/browser/editor/debug-expression-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;AAClF;;;gGAGgG;;;;;;;;;AAEhG,
|
|
1
|
+
{"version":3,"file":"debug-expression-provider.js","sourceRoot":"","sources":["../../../src/browser/editor/debug-expression-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;AAClF;;;gGAGgG;;;;;;;;;AAEhG,4DAA0D;AAE1D;;GAEG;AAEH,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAChC,GAAG,CAAC,KAA2B,EAAE,SAAwB;QACrD,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QACpE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE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T;aACJ;YAED,IAAI,mBAAmB,EAAE;gBACrB,kBAAkB,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;aACjF;SACJ;QAED,OAAO,kBAAkB,CAAC,CAAC;YACvB,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAAG,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;YAC1E,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IAC7B,CAAC;CACJ,CAAA;AAlDY,uBAAuB;IADnC,sBAAU,EAAE;GACA,uBAAuB,CAkDnC;AAlDY,0DAAuB"}
|
|
@@ -14,19 +14,6 @@
|
|
|
14
14
|
*
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
|
-
var __extends = (this && this.__extends) || (function () {
|
|
18
|
-
var extendStatics = function (d, b) {
|
|
19
|
-
extendStatics = Object.setPrototypeOf ||
|
|
20
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
22
|
-
return extendStatics(d, b);
|
|
23
|
-
};
|
|
24
|
-
return function (d, b) {
|
|
25
|
-
extendStatics(d, b);
|
|
26
|
-
function __() { this.constructor = d; }
|
|
27
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
-
};
|
|
29
|
-
})();
|
|
30
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
31
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
32
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -36,249 +23,96 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
36
23
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
37
24
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
38
25
|
};
|
|
39
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
40
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
41
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
42
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
43
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
44
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
45
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
49
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
50
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
51
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
52
|
-
function step(op) {
|
|
53
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
54
|
-
while (_) try {
|
|
55
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
56
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
57
|
-
switch (op[0]) {
|
|
58
|
-
case 0: case 1: t = op; break;
|
|
59
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
60
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
61
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
62
|
-
default:
|
|
63
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
64
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
65
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
66
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
67
|
-
if (t[2]) _.ops.pop();
|
|
68
|
-
_.trys.pop(); continue;
|
|
69
|
-
}
|
|
70
|
-
op = body.call(thisArg, _);
|
|
71
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
72
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
76
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
77
|
-
if (!m) return o;
|
|
78
|
-
var i = m.call(o), r, ar = [], e;
|
|
79
|
-
try {
|
|
80
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
81
|
-
}
|
|
82
|
-
catch (error) { e = { error: error }; }
|
|
83
|
-
finally {
|
|
84
|
-
try {
|
|
85
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
86
|
-
}
|
|
87
|
-
finally { if (e) throw e.error; }
|
|
88
|
-
}
|
|
89
|
-
return ar;
|
|
90
|
-
};
|
|
91
|
-
var __spread = (this && this.__spread) || function () {
|
|
92
|
-
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
93
|
-
return ar;
|
|
94
|
-
};
|
|
95
|
-
var __values = (this && this.__values) || function(o) {
|
|
96
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
97
|
-
if (m) return m.call(o);
|
|
98
|
-
if (o && typeof o.length === "number") return {
|
|
99
|
-
next: function () {
|
|
100
|
-
if (o && i >= o.length) o = void 0;
|
|
101
|
-
return { value: o && o[i++], done: !o };
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
105
|
-
};
|
|
106
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
107
27
|
exports.DebugHoverSource = void 0;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
28
|
+
const React = require("@theia/core/shared/react");
|
|
29
|
+
const source_tree_1 = require("@theia/core/lib/browser/source-tree");
|
|
30
|
+
const debug_console_items_1 = require("../console/debug-console-items");
|
|
31
|
+
const debug_session_manager_1 = require("../debug-session-manager");
|
|
32
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
+
let DebugHoverSource = class DebugHoverSource extends source_tree_1.TreeSource {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
this.elements = [];
|
|
37
|
+
}
|
|
38
|
+
get expression() {
|
|
39
|
+
return this._expression;
|
|
119
40
|
}
|
|
120
|
-
|
|
121
|
-
get: function () {
|
|
122
|
-
return this._expression;
|
|
123
|
-
},
|
|
124
|
-
enumerable: false,
|
|
125
|
-
configurable: true
|
|
126
|
-
});
|
|
127
|
-
DebugHoverSource.prototype.getElements = function () {
|
|
41
|
+
getElements() {
|
|
128
42
|
return this.elements[Symbol.iterator]();
|
|
129
|
-
}
|
|
130
|
-
|
|
43
|
+
}
|
|
44
|
+
renderTitle(element) {
|
|
131
45
|
return React.createElement("div", { className: 'theia-debug-hover-title', title: element.value }, element.value);
|
|
132
|
-
}
|
|
133
|
-
|
|
46
|
+
}
|
|
47
|
+
reset() {
|
|
134
48
|
this._expression = undefined;
|
|
135
49
|
this.elements = [];
|
|
136
50
|
this.fireDidChange();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (!!scopes_1_1.done) return [3 /*break*/, 6];
|
|
204
|
-
scope = scopes_1_1.value;
|
|
205
|
-
return [4 /*yield*/, this.doFindVariable(scope, namesToFind)];
|
|
206
|
-
case 4:
|
|
207
|
-
found = _b.sent();
|
|
208
|
-
if (!variable) {
|
|
209
|
-
variable = found;
|
|
210
|
-
}
|
|
211
|
-
else if (found && found.value !== variable.value) {
|
|
212
|
-
// only show if all expressions found have the same value
|
|
213
|
-
return [2 /*return*/, undefined];
|
|
214
|
-
}
|
|
215
|
-
_b.label = 5;
|
|
216
|
-
case 5:
|
|
217
|
-
scopes_1_1 = scopes_1.next();
|
|
218
|
-
return [3 /*break*/, 3];
|
|
219
|
-
case 6: return [3 /*break*/, 9];
|
|
220
|
-
case 7:
|
|
221
|
-
e_1_1 = _b.sent();
|
|
222
|
-
e_1 = { error: e_1_1 };
|
|
223
|
-
return [3 /*break*/, 9];
|
|
224
|
-
case 8:
|
|
225
|
-
try {
|
|
226
|
-
if (scopes_1_1 && !scopes_1_1.done && (_a = scopes_1.return)) _a.call(scopes_1);
|
|
227
|
-
}
|
|
228
|
-
finally { if (e_1) throw e_1.error; }
|
|
229
|
-
return [7 /*endfinally*/];
|
|
230
|
-
case 9: return [2 /*return*/, variable];
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
};
|
|
235
|
-
DebugHoverSource.prototype.doFindVariable = function (owner, namesToFind) {
|
|
236
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
237
|
-
var elements, variables, elements_1, elements_1_1, element;
|
|
238
|
-
var e_2, _a;
|
|
239
|
-
return __generator(this, function (_b) {
|
|
240
|
-
switch (_b.label) {
|
|
241
|
-
case 0: return [4 /*yield*/, owner.getElements()];
|
|
242
|
-
case 1:
|
|
243
|
-
elements = _b.sent();
|
|
244
|
-
variables = [];
|
|
245
|
-
try {
|
|
246
|
-
for (elements_1 = __values(elements), elements_1_1 = elements_1.next(); !elements_1_1.done; elements_1_1 = elements_1.next()) {
|
|
247
|
-
element = elements_1_1.value;
|
|
248
|
-
if (element instanceof debug_console_items_1.DebugVariable && element.name === namesToFind[0]) {
|
|
249
|
-
variables.push(element);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
254
|
-
finally {
|
|
255
|
-
try {
|
|
256
|
-
if (elements_1_1 && !elements_1_1.done && (_a = elements_1.return)) _a.call(elements_1);
|
|
257
|
-
}
|
|
258
|
-
finally { if (e_2) throw e_2.error; }
|
|
259
|
-
}
|
|
260
|
-
if (variables.length !== 1) {
|
|
261
|
-
return [2 /*return*/, undefined];
|
|
262
|
-
}
|
|
263
|
-
if (namesToFind.length === 1) {
|
|
264
|
-
return [2 /*return*/, variables[0]];
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
return [2 /*return*/, this.doFindVariable(variables[0], namesToFind.slice(1))];
|
|
268
|
-
}
|
|
269
|
-
return [2 /*return*/];
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
};
|
|
274
|
-
__decorate([
|
|
275
|
-
inversify_1.inject(debug_session_manager_1.DebugSessionManager),
|
|
276
|
-
__metadata("design:type", debug_session_manager_1.DebugSessionManager)
|
|
277
|
-
], DebugHoverSource.prototype, "sessions", void 0);
|
|
278
|
-
DebugHoverSource = __decorate([
|
|
279
|
-
inversify_1.injectable()
|
|
280
|
-
], DebugHoverSource);
|
|
281
|
-
return DebugHoverSource;
|
|
282
|
-
}(source_tree_1.TreeSource));
|
|
51
|
+
}
|
|
52
|
+
async evaluate(expression) {
|
|
53
|
+
const evaluated = await this.doEvaluate(expression);
|
|
54
|
+
const elements = evaluated && await evaluated.getElements();
|
|
55
|
+
this._expression = evaluated;
|
|
56
|
+
this.elements = elements ? [...elements] : [];
|
|
57
|
+
this.fireDidChange();
|
|
58
|
+
return evaluated;
|
|
59
|
+
}
|
|
60
|
+
async doEvaluate(expression) {
|
|
61
|
+
const { currentSession } = this.sessions;
|
|
62
|
+
if (!currentSession) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if (currentSession.capabilities.supportsEvaluateForHovers) {
|
|
66
|
+
const item = new debug_console_items_1.ExpressionItem(expression, () => currentSession);
|
|
67
|
+
await item.evaluate('hover');
|
|
68
|
+
return item.available && item || undefined;
|
|
69
|
+
}
|
|
70
|
+
return this.findVariable(expression.split('.').map(word => word.trim()).filter(word => !!word));
|
|
71
|
+
}
|
|
72
|
+
async findVariable(namesToFind) {
|
|
73
|
+
const { currentFrame } = this.sessions;
|
|
74
|
+
if (!currentFrame) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
let variable;
|
|
78
|
+
const scopes = await currentFrame.getScopes();
|
|
79
|
+
for (const scope of scopes) {
|
|
80
|
+
const found = await this.doFindVariable(scope, namesToFind);
|
|
81
|
+
if (!variable) {
|
|
82
|
+
variable = found;
|
|
83
|
+
}
|
|
84
|
+
else if (found && found.value !== variable.value) {
|
|
85
|
+
// only show if all expressions found have the same value
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return variable;
|
|
90
|
+
}
|
|
91
|
+
async doFindVariable(owner, namesToFind) {
|
|
92
|
+
const elements = await owner.getElements();
|
|
93
|
+
const variables = [];
|
|
94
|
+
for (const element of elements) {
|
|
95
|
+
if (element instanceof debug_console_items_1.DebugVariable && element.name === namesToFind[0]) {
|
|
96
|
+
variables.push(element);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (variables.length !== 1) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
if (namesToFind.length === 1) {
|
|
103
|
+
return variables[0];
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return this.doFindVariable(variables[0], namesToFind.slice(1));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
__decorate([
|
|
111
|
+
inversify_1.inject(debug_session_manager_1.DebugSessionManager),
|
|
112
|
+
__metadata("design:type", debug_session_manager_1.DebugSessionManager)
|
|
113
|
+
], DebugHoverSource.prototype, "sessions", void 0);
|
|
114
|
+
DebugHoverSource = __decorate([
|
|
115
|
+
inversify_1.injectable()
|
|
116
|
+
], DebugHoverSource);
|
|
283
117
|
exports.DebugHoverSource = DebugHoverSource;
|
|
284
118
|
//# sourceMappingURL=debug-hover-source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-hover-source.js","sourceRoot":"","sources":["../../../src/browser/editor/debug-hover-source.tsx"],"names":[],"mappings":";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,CAAC;IACpB,CAAC;IACS,KAAK,CAAC,cAAc,CAAC,KAA0B,EAAE,WAAqB;QAC5E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAoB,EAAE,CAAC;QACtC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,IAAI,OAAO,YAAY,mCAAa,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE;gBACrE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC3B;SACJ;QACD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACxB,OAAO,SAAS,CAAC;SACpB;QACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;SACvB;aAAM;YACH,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SAClE;IACL,CAAC;CAEJ,CAAA;AA9EG;IADC,kBAAM,CAAC,2CAAmB,CAAC;8BACC,2CAAmB;kDAAC;AAHxC,gBAAgB;IAD5B,sBAAU,EAAE;GACA,gBAAgB,CAiF5B;AAjFY,4CAAgB"}
|
|
@@ -14,19 +14,6 @@
|
|
|
14
14
|
*
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
|
-
var __extends = (this && this.__extends) || (function () {
|
|
18
|
-
var extendStatics = function (d, b) {
|
|
19
|
-
extendStatics = Object.setPrototypeOf ||
|
|
20
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
22
|
-
return extendStatics(d, b);
|
|
23
|
-
};
|
|
24
|
-
return function (d, b) {
|
|
25
|
-
extendStatics(d, b);
|
|
26
|
-
function __() { this.constructor = d; }
|
|
27
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
-
};
|
|
29
|
-
})();
|
|
30
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
31
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
32
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -36,57 +23,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
36
23
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
37
24
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
38
25
|
};
|
|
39
|
-
var
|
|
40
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
41
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
42
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
43
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
44
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
45
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
49
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
50
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
51
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
52
|
-
function step(op) {
|
|
53
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
54
|
-
while (_) try {
|
|
55
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
56
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
57
|
-
switch (op[0]) {
|
|
58
|
-
case 0: case 1: t = op; break;
|
|
59
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
60
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
61
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
62
|
-
default:
|
|
63
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
64
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
65
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
66
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
67
|
-
if (t[2]) _.ops.pop();
|
|
68
|
-
_.trys.pop(); continue;
|
|
69
|
-
}
|
|
70
|
-
op = body.call(thisArg, _);
|
|
71
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
72
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
73
|
-
}
|
|
74
|
-
};
|
|
26
|
+
var DebugHoverWidget_1;
|
|
75
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
28
|
exports.DebugHoverWidget = exports.createDebugHoverWidgetContainer = void 0;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
29
|
+
const debounce = require("@theia/core/shared/lodash.debounce");
|
|
30
|
+
const widgets_1 = require("@theia/core/shared/@phosphor/widgets");
|
|
31
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
32
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
33
|
+
const source_tree_1 = require("@theia/core/lib/browser/source-tree");
|
|
34
|
+
const disposable_1 = require("@theia/core/lib/common/disposable");
|
|
35
|
+
const debug_session_manager_1 = require("../debug-session-manager");
|
|
36
|
+
const debug_editor_1 = require("./debug-editor");
|
|
37
|
+
const debug_expression_provider_1 = require("./debug-expression-provider");
|
|
38
|
+
const debug_hover_source_1 = require("./debug-hover-source");
|
|
39
|
+
const debug_console_items_1 = require("../console/debug-console-items");
|
|
88
40
|
function createDebugHoverWidgetContainer(parent, editor) {
|
|
89
|
-
|
|
41
|
+
const child = source_tree_1.SourceTreeWidget.createContainer(parent, {
|
|
90
42
|
virtualized: false
|
|
91
43
|
});
|
|
92
44
|
child.bind(debug_editor_1.DebugEditor).toConstantValue(editor);
|
|
@@ -97,28 +49,24 @@ function createDebugHoverWidgetContainer(parent, editor) {
|
|
|
97
49
|
return child;
|
|
98
50
|
}
|
|
99
51
|
exports.createDebugHoverWidgetContainer = createDebugHoverWidgetContainer;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
_this.doSchedule = debounce(function (fn) { return fn(); }, 300);
|
|
110
|
-
return _this;
|
|
52
|
+
let DebugHoverWidget = DebugHoverWidget_1 = class DebugHoverWidget extends source_tree_1.SourceTreeWidget {
|
|
53
|
+
constructor() {
|
|
54
|
+
super(...arguments);
|
|
55
|
+
this.toDispose = new disposable_1.DisposableCollection();
|
|
56
|
+
this.allowEditorOverflow = true;
|
|
57
|
+
this.domNode = document.createElement('div');
|
|
58
|
+
this.titleNode = document.createElement('div');
|
|
59
|
+
this.contentNode = document.createElement('div');
|
|
60
|
+
this.doSchedule = debounce((fn) => fn(), 300);
|
|
111
61
|
}
|
|
112
|
-
|
|
113
|
-
DebugHoverWidget.prototype.getId = function () {
|
|
62
|
+
getId() {
|
|
114
63
|
return DebugHoverWidget_1.ID;
|
|
115
|
-
}
|
|
116
|
-
|
|
64
|
+
}
|
|
65
|
+
getDomNode() {
|
|
117
66
|
return this.domNode;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
_super.prototype.init.call(this);
|
|
67
|
+
}
|
|
68
|
+
init() {
|
|
69
|
+
super.init();
|
|
122
70
|
this.domNode.className = 'theia-debug-hover';
|
|
123
71
|
this.titleNode.className = 'theia-debug-hover-title';
|
|
124
72
|
this.domNode.appendChild(this.titleNode);
|
|
@@ -128,28 +76,25 @@ var DebugHoverWidget = /** @class */ (function (_super) {
|
|
|
128
76
|
this.source = this.hoverSource;
|
|
129
77
|
this.toDispose.pushAll([
|
|
130
78
|
this.hoverSource,
|
|
131
|
-
disposable_1.Disposable.create(
|
|
132
|
-
disposable_1.Disposable.create(
|
|
133
|
-
this.sessions.onDidChange(
|
|
134
|
-
if (!
|
|
135
|
-
|
|
79
|
+
disposable_1.Disposable.create(() => this.editor.getControl().removeContentWidget(this)),
|
|
80
|
+
disposable_1.Disposable.create(() => this.hide()),
|
|
81
|
+
this.sessions.onDidChange(() => {
|
|
82
|
+
if (!this.isEditorFrame()) {
|
|
83
|
+
this.hide();
|
|
136
84
|
}
|
|
137
85
|
})
|
|
138
86
|
]);
|
|
139
|
-
}
|
|
140
|
-
|
|
87
|
+
}
|
|
88
|
+
dispose() {
|
|
141
89
|
this.toDispose.dispose();
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
};
|
|
151
|
-
DebugHoverWidget.prototype.schedule = function (fn, immediate) {
|
|
152
|
-
if (immediate === void 0) { immediate = true; }
|
|
90
|
+
}
|
|
91
|
+
show(options) {
|
|
92
|
+
this.schedule(() => this.doShow(options), options && options.immediate);
|
|
93
|
+
}
|
|
94
|
+
hide(options) {
|
|
95
|
+
this.schedule(() => this.doHide(), options && options.immediate);
|
|
96
|
+
}
|
|
97
|
+
schedule(fn, immediate = true) {
|
|
153
98
|
if (immediate) {
|
|
154
99
|
this.doSchedule.cancel();
|
|
155
100
|
fn();
|
|
@@ -157,8 +102,8 @@ var DebugHoverWidget = /** @class */ (function (_super) {
|
|
|
157
102
|
else {
|
|
158
103
|
this.doSchedule(fn);
|
|
159
104
|
}
|
|
160
|
-
}
|
|
161
|
-
|
|
105
|
+
}
|
|
106
|
+
doHide() {
|
|
162
107
|
if (!this.isVisible) {
|
|
163
108
|
return;
|
|
164
109
|
}
|
|
@@ -169,97 +114,82 @@ var DebugHoverWidget = /** @class */ (function (_super) {
|
|
|
169
114
|
widgets_1.Widget.detach(this);
|
|
170
115
|
}
|
|
171
116
|
this.hoverSource.reset();
|
|
172
|
-
|
|
117
|
+
super.hide();
|
|
173
118
|
this.options = undefined;
|
|
174
119
|
this.editor.getControl().layoutContentWidget(this);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
this.titleNode.classList.add('string');
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
_super.prototype.show.call(this);
|
|
241
|
-
return [4 /*yield*/, new Promise(function (resolve) {
|
|
242
|
-
setTimeout(function () { return window.requestAnimationFrame(function () {
|
|
243
|
-
_this.editor.getControl().layoutContentWidget(_this);
|
|
244
|
-
resolve();
|
|
245
|
-
}); }, 0);
|
|
246
|
-
})];
|
|
247
|
-
case 2:
|
|
248
|
-
_a.sent();
|
|
249
|
-
return [2 /*return*/];
|
|
250
|
-
}
|
|
251
|
-
});
|
|
120
|
+
}
|
|
121
|
+
async doShow(options = this.options) {
|
|
122
|
+
if (!this.isEditorFrame()) {
|
|
123
|
+
this.hide();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (!options) {
|
|
127
|
+
this.hide();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (this.options && this.options.selection.equalsRange(options.selection)) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (!this.isAttached) {
|
|
134
|
+
widgets_1.Widget.attach(this, this.contentNode);
|
|
135
|
+
}
|
|
136
|
+
this.options = options;
|
|
137
|
+
const matchingExpression = this.expressionProvider.get(this.editor.getControl().getModel(), options.selection);
|
|
138
|
+
if (!matchingExpression) {
|
|
139
|
+
this.hide();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const toFocus = new disposable_1.DisposableCollection();
|
|
143
|
+
if (this.options.focus === true) {
|
|
144
|
+
toFocus.push(this.model.onNodeRefreshed(() => {
|
|
145
|
+
toFocus.dispose();
|
|
146
|
+
this.activate();
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
const expression = await this.hoverSource.evaluate(matchingExpression);
|
|
150
|
+
if (!expression) {
|
|
151
|
+
toFocus.dispose();
|
|
152
|
+
this.hide();
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this.contentNode.hidden = false;
|
|
156
|
+
['number', 'boolean', 'string'].forEach(token => this.titleNode.classList.remove(token));
|
|
157
|
+
this.domNode.classList.remove('complex-value');
|
|
158
|
+
if (expression.hasElements) {
|
|
159
|
+
this.domNode.classList.add('complex-value');
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
this.contentNode.hidden = true;
|
|
163
|
+
if (expression.type === 'number' || expression.type === 'boolean' || expression.type === 'string') {
|
|
164
|
+
this.titleNode.classList.add(expression.type);
|
|
165
|
+
}
|
|
166
|
+
else if (!isNaN(+expression.value)) {
|
|
167
|
+
this.titleNode.classList.add('number');
|
|
168
|
+
}
|
|
169
|
+
else if (debug_console_items_1.DebugVariable.booleanRegex.test(expression.value)) {
|
|
170
|
+
this.titleNode.classList.add('boolean');
|
|
171
|
+
}
|
|
172
|
+
else if (debug_console_items_1.DebugVariable.stringRegex.test(expression.value)) {
|
|
173
|
+
this.titleNode.classList.add('string');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
super.show();
|
|
177
|
+
await new Promise(resolve => {
|
|
178
|
+
setTimeout(() => window.requestAnimationFrame(() => {
|
|
179
|
+
this.editor.getControl().layoutContentWidget(this);
|
|
180
|
+
resolve();
|
|
181
|
+
}), 0);
|
|
252
182
|
});
|
|
253
|
-
}
|
|
254
|
-
|
|
183
|
+
}
|
|
184
|
+
isEditorFrame() {
|
|
255
185
|
return this.sessions.isCurrentEditorFrame(this.editor.getControl().getModel().uri);
|
|
256
|
-
}
|
|
257
|
-
|
|
186
|
+
}
|
|
187
|
+
getPosition() {
|
|
258
188
|
if (!this.isVisible) {
|
|
259
189
|
return undefined;
|
|
260
190
|
}
|
|
261
|
-
|
|
262
|
-
|
|
191
|
+
const position = this.options && this.options.selection.getStartPosition();
|
|
192
|
+
const word = position && this.editor.getControl().getModel().getWordAtPosition(position);
|
|
263
193
|
return position && word ? {
|
|
264
194
|
position: new monaco.Position(position.lineNumber, word.startColumn),
|
|
265
195
|
preference: [
|
|
@@ -267,47 +197,44 @@ var DebugHoverWidget = /** @class */ (function (_super) {
|
|
|
267
197
|
monaco.editor.ContentWidgetPositionPreference.BELOW
|
|
268
198
|
]
|
|
269
199
|
} : undefined;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
200
|
+
}
|
|
201
|
+
onUpdateRequest(msg) {
|
|
202
|
+
super.onUpdateRequest(msg);
|
|
203
|
+
const { expression } = this.hoverSource;
|
|
204
|
+
const value = expression && expression.value || '';
|
|
275
205
|
this.titleNode.textContent = value;
|
|
276
206
|
this.titleNode.title = value;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
], DebugHoverWidget);
|
|
310
|
-
return DebugHoverWidget;
|
|
311
|
-
}(source_tree_1.SourceTreeWidget));
|
|
207
|
+
}
|
|
208
|
+
onAfterAttach(msg) {
|
|
209
|
+
super.onAfterAttach(msg);
|
|
210
|
+
this.addKeyListener(this.domNode, browser_1.Key.ESCAPE, () => this.hide());
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
DebugHoverWidget.ID = 'debug.editor.hover';
|
|
214
|
+
__decorate([
|
|
215
|
+
inversify_1.inject(debug_editor_1.DebugEditor),
|
|
216
|
+
__metadata("design:type", Object)
|
|
217
|
+
], DebugHoverWidget.prototype, "editor", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
inversify_1.inject(debug_session_manager_1.DebugSessionManager),
|
|
220
|
+
__metadata("design:type", debug_session_manager_1.DebugSessionManager)
|
|
221
|
+
], DebugHoverWidget.prototype, "sessions", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
inversify_1.inject(debug_hover_source_1.DebugHoverSource),
|
|
224
|
+
__metadata("design:type", debug_hover_source_1.DebugHoverSource)
|
|
225
|
+
], DebugHoverWidget.prototype, "hoverSource", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
inversify_1.inject(debug_expression_provider_1.DebugExpressionProvider),
|
|
228
|
+
__metadata("design:type", debug_expression_provider_1.DebugExpressionProvider)
|
|
229
|
+
], DebugHoverWidget.prototype, "expressionProvider", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
inversify_1.postConstruct(),
|
|
232
|
+
__metadata("design:type", Function),
|
|
233
|
+
__metadata("design:paramtypes", []),
|
|
234
|
+
__metadata("design:returntype", void 0)
|
|
235
|
+
], DebugHoverWidget.prototype, "init", null);
|
|
236
|
+
DebugHoverWidget = DebugHoverWidget_1 = __decorate([
|
|
237
|
+
inversify_1.injectable()
|
|
238
|
+
], DebugHoverWidget);
|
|
312
239
|
exports.DebugHoverWidget = DebugHoverWidget;
|
|
313
240
|
//# sourceMappingURL=debug-hover-widget.js.map
|