@theia/debug 1.31.0-next.13 → 1.31.0-next.14
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/editor/debug-inline-value-decorator.d.ts +4 -3
- package/lib/browser/editor/debug-inline-value-decorator.d.ts.map +1 -1
- package/lib/browser/editor/debug-inline-value-decorator.js +160 -41
- package/lib/browser/editor/debug-inline-value-decorator.js.map +1 -1
- package/package.json +14 -14
- package/src/browser/editor/debug-inline-value-decorator.ts +176 -42
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
|
|
1
2
|
import * as monaco from '@theia/monaco-editor-core';
|
|
2
3
|
import { IDecorationOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/editorCommon';
|
|
3
|
-
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
|
|
4
4
|
import { MonacoEditorService } from '@theia/monaco/lib/browser/monaco-editor-service';
|
|
5
5
|
import { DebugPreferences } from '../debug-preferences';
|
|
6
|
-
import { DebugEditorModel } from './debug-editor-model';
|
|
7
6
|
import { DebugStackFrame } from '../model/debug-stack-frame';
|
|
7
|
+
import { DebugEditorModel } from './debug-editor-model';
|
|
8
8
|
export declare const INLINE_VALUE_DECORATION_KEY = "inlinevaluedecoration";
|
|
9
9
|
export declare class DebugInlineValueDecorator implements FrontendApplicationContribution {
|
|
10
10
|
protected readonly editorService: MonacoEditorService;
|
|
@@ -13,8 +13,9 @@ export declare class DebugInlineValueDecorator implements FrontendApplicationCon
|
|
|
13
13
|
protected wordToLineNumbersMap: Map<string, monaco.Position[]> | undefined;
|
|
14
14
|
onStart(): void;
|
|
15
15
|
calculateDecorations(debugEditorModel: DebugEditorModel, stackFrame: DebugStackFrame | undefined): Promise<IDecorationOptions[]>;
|
|
16
|
-
protected updateInlineValueDecorations(model: monaco.editor.ITextModel | undefined, stackFrame: DebugStackFrame | undefined): Promise<IDecorationOptions[]>;
|
|
16
|
+
protected updateInlineValueDecorations(debugEditorModel: DebugEditorModel, model: monaco.editor.ITextModel | undefined, stackFrame: DebugStackFrame | undefined): Promise<IDecorationOptions[]>;
|
|
17
17
|
private createInlineValueDecorationsInsideRange;
|
|
18
|
+
protected formatInlineValue(...args: string[]): string;
|
|
18
19
|
private createInlineValueDecoration;
|
|
19
20
|
private getWordToPositionsMap;
|
|
20
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-inline-value-decorator.d.ts","sourceRoot":"","sources":["../../../src/browser/editor/debug-inline-value-decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debug-inline-value-decorator.d.ts","sourceRoot":"","sources":["../../../src/browser/editor/debug-inline-value-decorator.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAE/F,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAGpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAC;AAKjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AAmBnE,qBACa,yBAA0B,YAAW,+BAA+B;IAG7E,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAGtD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IAEjD,SAAS,CAAC,OAAO,UAAS;IAC1B,SAAS,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,SAAS,CAAa;IAEvF,OAAO,IAAI,IAAI;IAUT,oBAAoB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;cAOtH,4BAA4B,CACxC,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,GAAG,SAAS,EAC3C,UAAU,EAAE,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;YA6B7D,uCAAuC;IAiKrD,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM;IAetD,OAAO,CAAC,2BAA2B;IAkCnC,OAAO,CAAC,qBAAqB;CA8ChC"}
|
|
@@ -25,14 +25,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.DebugInlineValueDecorator = exports.INLINE_VALUE_DECORATION_KEY = void 0;
|
|
28
|
-
/*---------------------------------------------------------------------------------------------
|
|
29
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
30
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
31
|
-
*--------------------------------------------------------------------------------------------*/
|
|
32
|
-
// Based on https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
|
|
33
28
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
34
29
|
const monaco = require("@theia/monaco-editor-core");
|
|
30
|
+
const cancellation_1 = require("@theia/monaco-editor-core/esm/vs/base/common/cancellation");
|
|
35
31
|
const wordHelper_1 = require("@theia/monaco-editor-core/esm/vs/editor/common/core/wordHelper");
|
|
32
|
+
const languageFeatures_1 = require("@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures");
|
|
33
|
+
const standaloneServices_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices");
|
|
36
34
|
const monaco_editor_service_1 = require("@theia/monaco/lib/browser/monaco-editor-service");
|
|
37
35
|
const debug_console_items_1 = require("../console/debug-console-items");
|
|
38
36
|
const debug_preferences_1 = require("../debug-preferences");
|
|
@@ -49,6 +47,12 @@ const MAX_TOKENIZATION_LINE_LEN = 500; // If line is too long, then inline value
|
|
|
49
47
|
*/
|
|
50
48
|
// https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/base/common/uint.ts#L7-L13
|
|
51
49
|
const MAX_SAFE_SMALL_INTEGER = 1 << 30;
|
|
50
|
+
class InlineSegment {
|
|
51
|
+
constructor(column, text) {
|
|
52
|
+
this.column = column;
|
|
53
|
+
this.text = text;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
52
56
|
let DebugInlineValueDecorator = class DebugInlineValueDecorator {
|
|
53
57
|
constructor() {
|
|
54
58
|
this.enabled = false;
|
|
@@ -66,10 +70,10 @@ let DebugInlineValueDecorator = class DebugInlineValueDecorator {
|
|
|
66
70
|
async calculateDecorations(debugEditorModel, stackFrame) {
|
|
67
71
|
this.wordToLineNumbersMap = undefined;
|
|
68
72
|
const model = debugEditorModel.editor.getControl().getModel() || undefined;
|
|
69
|
-
return this.updateInlineValueDecorations(model, stackFrame);
|
|
73
|
+
return this.updateInlineValueDecorations(debugEditorModel, model, stackFrame);
|
|
70
74
|
}
|
|
71
75
|
// https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L382-L408
|
|
72
|
-
async updateInlineValueDecorations(model, stackFrame) {
|
|
76
|
+
async updateInlineValueDecorations(debugEditorModel, model, stackFrame) {
|
|
73
77
|
if (!this.enabled || !model || !stackFrame || !stackFrame.source || model.uri.toString() !== stackFrame.source.uri.toString()) {
|
|
74
78
|
return [];
|
|
75
79
|
}
|
|
@@ -87,51 +91,166 @@ let DebugInlineValueDecorator = class DebugInlineValueDecorator {
|
|
|
87
91
|
if (scope.range) {
|
|
88
92
|
range = range.setStartPosition(scope.range.startLineNumber, scope.range.startColumn);
|
|
89
93
|
}
|
|
90
|
-
return this.createInlineValueDecorationsInsideRange(children, range, model);
|
|
94
|
+
return this.createInlineValueDecorationsInsideRange(children, range, model, debugEditorModel, stackFrame);
|
|
91
95
|
}));
|
|
92
96
|
return decorationsPerScope.reduce((previous, current) => previous.concat(current), []);
|
|
93
97
|
}
|
|
94
98
|
// https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L410-L452
|
|
95
|
-
createInlineValueDecorationsInsideRange(expressions, range, model) {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
99
|
+
async createInlineValueDecorationsInsideRange(expressions, range, model, debugEditorModel, stackFrame) {
|
|
100
|
+
const decorations = [];
|
|
101
|
+
const inlineValuesProvider = standaloneServices_1.StandaloneServices.get(languageFeatures_1.ILanguageFeaturesService).inlineValuesProvider;
|
|
102
|
+
const textEditorModel = debugEditorModel.editor.document.textEditorModel;
|
|
103
|
+
if (inlineValuesProvider && inlineValuesProvider.has(textEditorModel)) {
|
|
104
|
+
const findVariable = async (variableName, caseSensitiveLookup) => {
|
|
105
|
+
const scopes = await stackFrame.getMostSpecificScopes(stackFrame.range);
|
|
106
|
+
const key = caseSensitiveLookup ? variableName : variableName.toLowerCase();
|
|
107
|
+
for (const scope of scopes) {
|
|
108
|
+
const expressionContainers = await scope.getElements();
|
|
109
|
+
let container = expressionContainers.next();
|
|
110
|
+
while (!container.done) {
|
|
111
|
+
const debugVariable = container.value;
|
|
112
|
+
if (debugVariable && debugVariable instanceof debug_console_items_1.DebugVariable) {
|
|
113
|
+
if (caseSensitiveLookup) {
|
|
114
|
+
if (debugVariable.name === key) {
|
|
115
|
+
return debugVariable;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
if (debugVariable.name.toLowerCase() === key) {
|
|
120
|
+
return debugVariable;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
116
123
|
}
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
container = expressionContainers.next();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return undefined;
|
|
128
|
+
};
|
|
129
|
+
const context = {
|
|
130
|
+
frameId: stackFrame.raw.id,
|
|
131
|
+
stoppedLocation: range
|
|
132
|
+
};
|
|
133
|
+
const cancellationToken = new cancellation_1.CancellationTokenSource().token;
|
|
134
|
+
const registeredProviders = inlineValuesProvider.ordered(textEditorModel).reverse();
|
|
135
|
+
const visibleRanges = debugEditorModel.editor.getControl().getVisibleRanges();
|
|
136
|
+
const lineDecorations = new Map();
|
|
137
|
+
for (const provider of registeredProviders) {
|
|
138
|
+
for (const visibleRange of visibleRanges) {
|
|
139
|
+
const result = await provider.provideInlineValues(textEditorModel, visibleRange, context, cancellationToken);
|
|
140
|
+
if (result) {
|
|
141
|
+
for (const inlineValue of result) {
|
|
142
|
+
let text = undefined;
|
|
143
|
+
switch (inlineValue.type) {
|
|
144
|
+
case 'text':
|
|
145
|
+
text = inlineValue.text;
|
|
146
|
+
break;
|
|
147
|
+
case 'variable': {
|
|
148
|
+
let varName = inlineValue.variableName;
|
|
149
|
+
if (!varName) {
|
|
150
|
+
const lineContent = model.getLineContent(inlineValue.range.startLineNumber);
|
|
151
|
+
varName = lineContent.substring(inlineValue.range.startColumn - 1, inlineValue.range.endColumn - 1);
|
|
152
|
+
}
|
|
153
|
+
const variable = await findVariable(varName, inlineValue.caseSensitiveLookup);
|
|
154
|
+
if (variable) {
|
|
155
|
+
text = this.formatInlineValue(varName, variable.value);
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
case 'expression': {
|
|
160
|
+
let expr = inlineValue.expression;
|
|
161
|
+
if (!expr) {
|
|
162
|
+
const lineContent = model.getLineContent(inlineValue.range.startLineNumber);
|
|
163
|
+
expr = lineContent.substring(inlineValue.range.startColumn - 1, inlineValue.range.endColumn - 1);
|
|
164
|
+
}
|
|
165
|
+
if (expr) {
|
|
166
|
+
const expression = new debug_console_items_1.ExpressionItem(expr, () => stackFrame.thread.session);
|
|
167
|
+
await expression.evaluate('watch');
|
|
168
|
+
if (expression.available) {
|
|
169
|
+
text = this.formatInlineValue(expr, expression.value);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (text) {
|
|
176
|
+
const line = inlineValue.range.startLineNumber;
|
|
177
|
+
let lineSegments = lineDecorations.get(line);
|
|
178
|
+
if (!lineSegments) {
|
|
179
|
+
lineSegments = [];
|
|
180
|
+
lineDecorations.set(line, lineSegments);
|
|
181
|
+
}
|
|
182
|
+
if (!lineSegments.some(segment => segment.text === text)) {
|
|
183
|
+
lineSegments.push(new InlineSegment(inlineValue.range.startColumn, text));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
119
186
|
}
|
|
120
187
|
}
|
|
121
188
|
}
|
|
122
189
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
190
|
+
;
|
|
191
|
+
// sort line segments and concatenate them into a decoration
|
|
192
|
+
const separator = ', ';
|
|
193
|
+
lineDecorations.forEach((segments, line) => {
|
|
194
|
+
if (segments.length > 0) {
|
|
195
|
+
segments = segments.sort((a, b) => a.column - b.column);
|
|
196
|
+
const text = segments.map(s => s.text).join(separator);
|
|
197
|
+
decorations.push(this.createInlineValueDecoration(line, text));
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
else { // use fallback if no provider was registered
|
|
202
|
+
const lineToNamesMap = new Map();
|
|
203
|
+
const nameValueMap = new Map();
|
|
204
|
+
for (const expr of expressions) {
|
|
205
|
+
if (expr instanceof debug_console_items_1.DebugVariable) { // XXX: VS Code uses `IExpression` that has `name` and `value`.
|
|
206
|
+
nameValueMap.set(expr.name, expr.value);
|
|
207
|
+
}
|
|
208
|
+
// Limit the size of map. Too large can have a perf impact
|
|
209
|
+
if (nameValueMap.size >= MAX_NUM_INLINE_VALUES) {
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
const wordToPositionsMap = this.getWordToPositionsMap(model);
|
|
214
|
+
// Compute unique set of names on each line
|
|
215
|
+
nameValueMap.forEach((_, name) => {
|
|
216
|
+
const positions = wordToPositionsMap.get(name);
|
|
217
|
+
if (positions) {
|
|
218
|
+
for (const position of positions) {
|
|
219
|
+
if (range.containsPosition(position)) {
|
|
220
|
+
if (!lineToNamesMap.has(position.lineNumber)) {
|
|
221
|
+
lineToNamesMap.set(position.lineNumber, []);
|
|
222
|
+
}
|
|
223
|
+
if (lineToNamesMap.get(position.lineNumber).indexOf(name) === -1) {
|
|
224
|
+
lineToNamesMap.get(position.lineNumber).push(name);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
// Compute decorators for each line
|
|
231
|
+
lineToNamesMap.forEach((names, line) => {
|
|
232
|
+
const contentText = names.sort((first, second) => {
|
|
233
|
+
const content = model.getLineContent(line);
|
|
234
|
+
return content.indexOf(first) - content.indexOf(second);
|
|
235
|
+
}).map(name => `${name} = ${nameValueMap.get(name)}`).join(', ');
|
|
236
|
+
decorations.push(this.createInlineValueDecoration(line, contentText));
|
|
237
|
+
});
|
|
238
|
+
}
|
|
133
239
|
return decorations;
|
|
134
240
|
}
|
|
241
|
+
formatInlineValue(...args) {
|
|
242
|
+
const valuePattern = '{0} = {1}';
|
|
243
|
+
const formatRegExp = /{(\d+)}/g;
|
|
244
|
+
if (args.length === 0) {
|
|
245
|
+
return valuePattern;
|
|
246
|
+
}
|
|
247
|
+
return valuePattern.replace(formatRegExp, (match, group) => {
|
|
248
|
+
const idx = parseInt(group, 10);
|
|
249
|
+
return isNaN(idx) || idx < 0 || idx >= args.length ?
|
|
250
|
+
match :
|
|
251
|
+
args[idx];
|
|
252
|
+
});
|
|
253
|
+
}
|
|
135
254
|
// https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L454-L485
|
|
136
255
|
createInlineValueDecoration(lineNumber, contentText) {
|
|
137
256
|
// If decoratorText is too long, trim and add ellipses. This could happen for minified files with everything on a single line
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-inline-value-decorator.js","sourceRoot":"","sources":["../../../src/browser/editor/debug-inline-value-decorator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;AAEhF;;;gGAGgG;AAChG,wIAAwI;AAExI,4DAAkE;AAClE,oDAAoD;AAIpD,+FAAqG;AAErG,2FAAsF;AACtF,wEAAoF;AACpF,4DAAwD;AAIxD,uIAAuI;AAC1H,QAAA,2BAA2B,GAAG,uBAAuB,CAAC;AACnE,MAAM,qBAAqB,GAAG,GAAG,CAAC,CAAC,qFAAqF;AACxH,MAAM,2BAA2B,GAAG,GAAG,CAAC,CAAC,sFAAsF;AAC/H,MAAM,yBAAyB,GAAG,GAAG,CAAC,CAAC,mEAAmE;AAE1G;;;;;GAKG;AACH,+FAA+F;AAC/F,MAAM,sBAAsB,GAAG,CAAC,IAAI,EAAE,CAAC;AAGvC,IAAa,yBAAyB,GAAtC,MAAa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AC,EAAE;gCACtC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;6BAC3C;4BAED,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC;yBAChG;qBACJ;iBACJ;aACJ;SACJ;QAED,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;CAEJ,CAAA;AA3LG;IADC,IAAA,kBAAM,EAAC,2CAAmB,CAAC;8BACM,2CAAmB;gEAAC;AAGtD;IADC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;8DACwB;AANxC,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CA8LrC;AA9LY,8DAAyB"}
|
|
1
|
+
{"version":3,"file":"debug-inline-value-decorator.js","sourceRoot":"","sources":["../../../src/browser/editor/debug-inline-value-decorator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;AAShF,4DAAkE;AAClE,oDAAoD;AACpD,4FAAoG;AACpG,+FAAqG;AAIrG,+GAAoH;AACpH,sHAAmH;AACnH,2FAAsF;AACtF,wEAAoG;AACpG,4DAAwD;AAIxD,uIAAuI;AAC1H,QAAA,2BAA2B,GAAG,uBAAuB,CAAC;AACnE,MAAM,qBAAqB,GAAG,GAAG,CAAC,CAAC,qFAAqF;AACxH,MAAM,2BAA2B,GAAG,GAAG,CAAC,CAAC,sFAAsF;AAC/H,MAAM,yBAAyB,GAAG,GAAG,CAAC,CAAC,mEAAmE;AAE1G;;;;;GAKG;AAC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QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;oBAEzE,oCAAoC;oBACpC,IAAI,SAAS,kBAA4B,EAAE;wBACvC,gCAAmB,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,+DAA+D;wBAClG,MAAM,SAAS,GAAG,gCAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;wBAErD,IAAI,SAAS,EAAE;4BACX,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;4BAC1B,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gCACtC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;6BAC3C;4BAED,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC;yBAChG;qBACJ;iBACJ;aACJ;SACJ;QAED,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;CAEJ,CAAA;AAzTG;IADC,IAAA,kBAAM,EAAC,2CAAmB,CAAC;8BACM,2CAAmB;gEAAC;AAGtD;IADC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;8DACwB;AANxC,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CA4TrC;AA5TY,8DAAyB"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/debug",
|
|
3
|
-
"version": "1.31.0-next.
|
|
3
|
+
"version": "1.31.0-next.14+807cf6d0a",
|
|
4
4
|
"description": "Theia - Debug Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/console": "1.31.0-next.
|
|
7
|
-
"@theia/core": "1.31.0-next.
|
|
8
|
-
"@theia/editor": "1.31.0-next.
|
|
9
|
-
"@theia/filesystem": "1.31.0-next.
|
|
10
|
-
"@theia/markers": "1.31.0-next.
|
|
11
|
-
"@theia/monaco": "1.31.0-next.
|
|
6
|
+
"@theia/console": "1.31.0-next.14+807cf6d0a",
|
|
7
|
+
"@theia/core": "1.31.0-next.14+807cf6d0a",
|
|
8
|
+
"@theia/editor": "1.31.0-next.14+807cf6d0a",
|
|
9
|
+
"@theia/filesystem": "1.31.0-next.14+807cf6d0a",
|
|
10
|
+
"@theia/markers": "1.31.0-next.14+807cf6d0a",
|
|
11
|
+
"@theia/monaco": "1.31.0-next.14+807cf6d0a",
|
|
12
12
|
"@theia/monaco-editor-core": "1.67.2",
|
|
13
|
-
"@theia/output": "1.31.0-next.
|
|
14
|
-
"@theia/process": "1.31.0-next.
|
|
15
|
-
"@theia/task": "1.31.0-next.
|
|
16
|
-
"@theia/terminal": "1.31.0-next.
|
|
17
|
-
"@theia/variable-resolver": "1.31.0-next.
|
|
18
|
-
"@theia/workspace": "1.31.0-next.
|
|
13
|
+
"@theia/output": "1.31.0-next.14+807cf6d0a",
|
|
14
|
+
"@theia/process": "1.31.0-next.14+807cf6d0a",
|
|
15
|
+
"@theia/task": "1.31.0-next.14+807cf6d0a",
|
|
16
|
+
"@theia/terminal": "1.31.0-next.14+807cf6d0a",
|
|
17
|
+
"@theia/variable-resolver": "1.31.0-next.14+807cf6d0a",
|
|
18
|
+
"@theia/workspace": "1.31.0-next.14+807cf6d0a",
|
|
19
19
|
"@vscode/debugprotocol": "^1.51.0",
|
|
20
20
|
"jsonc-parser": "^2.2.0",
|
|
21
21
|
"mkdirp": "^0.5.0",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"nyc": {
|
|
69
69
|
"extends": "../../configs/nyc.json"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "807cf6d0ab0217a7742bd49cd794d591b5a8ee84"
|
|
72
72
|
}
|
|
@@ -20,18 +20,21 @@
|
|
|
20
20
|
*--------------------------------------------------------------------------------------------*/
|
|
21
21
|
// Based on https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
|
|
22
22
|
|
|
23
|
+
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
|
|
23
24
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
24
25
|
import * as monaco from '@theia/monaco-editor-core';
|
|
26
|
+
import { CancellationTokenSource } from '@theia/monaco-editor-core/esm/vs/base/common/cancellation';
|
|
27
|
+
import { DEFAULT_WORD_REGEXP } from '@theia/monaco-editor-core/esm/vs/editor/common/core/wordHelper';
|
|
25
28
|
import { IDecorationOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/editorCommon';
|
|
29
|
+
import { InlineValueContext, StandardTokenType } from '@theia/monaco-editor-core/esm/vs/editor/common/languages';
|
|
26
30
|
import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
|
|
31
|
+
import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures';
|
|
32
|
+
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
30
33
|
import { MonacoEditorService } from '@theia/monaco/lib/browser/monaco-editor-service';
|
|
31
|
-
import { ExpressionContainer,
|
|
34
|
+
import { DebugVariable, ExpressionContainer, ExpressionItem } from '../console/debug-console-items';
|
|
32
35
|
import { DebugPreferences } from '../debug-preferences';
|
|
33
|
-
import { DebugEditorModel } from './debug-editor-model';
|
|
34
36
|
import { DebugStackFrame } from '../model/debug-stack-frame';
|
|
37
|
+
import { DebugEditorModel } from './debug-editor-model';
|
|
35
38
|
|
|
36
39
|
// https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L40-L43
|
|
37
40
|
export const INLINE_VALUE_DECORATION_KEY = 'inlinevaluedecoration';
|
|
@@ -48,6 +51,11 @@ const MAX_TOKENIZATION_LINE_LEN = 500; // If line is too long, then inline value
|
|
|
48
51
|
// https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/base/common/uint.ts#L7-L13
|
|
49
52
|
const MAX_SAFE_SMALL_INTEGER = 1 << 30;
|
|
50
53
|
|
|
54
|
+
class InlineSegment {
|
|
55
|
+
constructor(public column: number, public text: string) {
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
51
59
|
@injectable()
|
|
52
60
|
export class DebugInlineValueDecorator implements FrontendApplicationContribution {
|
|
53
61
|
|
|
@@ -73,11 +81,12 @@ export class DebugInlineValueDecorator implements FrontendApplicationContributio
|
|
|
73
81
|
async calculateDecorations(debugEditorModel: DebugEditorModel, stackFrame: DebugStackFrame | undefined): Promise<IDecorationOptions[]> {
|
|
74
82
|
this.wordToLineNumbersMap = undefined;
|
|
75
83
|
const model = debugEditorModel.editor.getControl().getModel() || undefined;
|
|
76
|
-
return this.updateInlineValueDecorations(model, stackFrame);
|
|
84
|
+
return this.updateInlineValueDecorations(debugEditorModel, model, stackFrame);
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
// https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L382-L408
|
|
80
88
|
protected async updateInlineValueDecorations(
|
|
89
|
+
debugEditorModel: DebugEditorModel,
|
|
81
90
|
model: monaco.editor.ITextModel | undefined,
|
|
82
91
|
stackFrame: DebugStackFrame | undefined): Promise<IDecorationOptions[]> {
|
|
83
92
|
|
|
@@ -101,63 +110,188 @@ export class DebugInlineValueDecorator implements FrontendApplicationContributio
|
|
|
101
110
|
range = range.setStartPosition(scope.range.startLineNumber, scope.range.startColumn);
|
|
102
111
|
}
|
|
103
112
|
|
|
104
|
-
return this.createInlineValueDecorationsInsideRange(children, range, model);
|
|
113
|
+
return this.createInlineValueDecorationsInsideRange(children, range, model, debugEditorModel, stackFrame);
|
|
105
114
|
}));
|
|
106
115
|
|
|
107
116
|
return decorationsPerScope.reduce((previous, current) => previous.concat(current), []);
|
|
108
117
|
}
|
|
109
118
|
|
|
110
119
|
// https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L410-L452
|
|
111
|
-
private createInlineValueDecorationsInsideRange(
|
|
120
|
+
private async createInlineValueDecorationsInsideRange(
|
|
112
121
|
expressions: ReadonlyArray<ExpressionContainer>,
|
|
113
122
|
range: monaco.Range,
|
|
114
|
-
model: monaco.editor.ITextModel
|
|
123
|
+
model: monaco.editor.ITextModel,
|
|
124
|
+
debugEditorModel: DebugEditorModel,
|
|
125
|
+
stackFrame: DebugStackFrame): Promise<IDecorationOptions[]> {
|
|
115
126
|
|
|
116
|
-
const
|
|
117
|
-
for (const expr of expressions) {
|
|
118
|
-
if (expr instanceof DebugVariable) { // XXX: VS Code uses `IExpression` that has `name` and `value`.
|
|
119
|
-
nameValueMap.set(expr.name, expr.value);
|
|
120
|
-
}
|
|
121
|
-
// Limit the size of map. Too large can have a perf impact
|
|
122
|
-
if (nameValueMap.size >= MAX_NUM_INLINE_VALUES) {
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
127
|
+
const decorations: IDecorationOptions[] = [];
|
|
126
128
|
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
const inlineValuesProvider = StandaloneServices.get(ILanguageFeaturesService).inlineValuesProvider;
|
|
130
|
+
const textEditorModel = debugEditorModel.editor.document.textEditorModel;
|
|
131
|
+
|
|
132
|
+
if (inlineValuesProvider && inlineValuesProvider.has(textEditorModel)) {
|
|
133
|
+
|
|
134
|
+
const findVariable = async (variableName: string, caseSensitiveLookup: boolean): Promise<DebugVariable | undefined> => {
|
|
135
|
+
const scopes = await stackFrame.getMostSpecificScopes(stackFrame.range!);
|
|
136
|
+
const key = caseSensitiveLookup ? variableName : variableName.toLowerCase();
|
|
137
|
+
for (const scope of scopes) {
|
|
138
|
+
const expressionContainers = await scope.getElements();
|
|
139
|
+
let container = expressionContainers.next();
|
|
140
|
+
while (!container.done) {
|
|
141
|
+
const debugVariable = container.value;
|
|
142
|
+
if (debugVariable && debugVariable instanceof DebugVariable) {
|
|
143
|
+
if (caseSensitiveLookup) {
|
|
144
|
+
if (debugVariable.name === key) {
|
|
145
|
+
return debugVariable;
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
if (debugVariable.name.toLowerCase() === key) {
|
|
149
|
+
return debugVariable;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
138
152
|
}
|
|
153
|
+
container = expressionContainers.next();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return undefined;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const context: InlineValueContext = {
|
|
160
|
+
frameId: stackFrame.raw.id,
|
|
161
|
+
stoppedLocation: range
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const cancellationToken = new CancellationTokenSource().token;
|
|
165
|
+
const registeredProviders = inlineValuesProvider.ordered(textEditorModel).reverse();
|
|
166
|
+
const visibleRanges = debugEditorModel.editor.getControl().getVisibleRanges();
|
|
167
|
+
|
|
168
|
+
const lineDecorations = new Map<number, InlineSegment[]>();
|
|
169
|
+
|
|
170
|
+
for (const provider of registeredProviders) {
|
|
171
|
+
for (const visibleRange of visibleRanges) {
|
|
172
|
+
const result = await provider.provideInlineValues(textEditorModel, visibleRange, context, cancellationToken);
|
|
173
|
+
if (result) {
|
|
174
|
+
for (const inlineValue of result) {
|
|
175
|
+
let text: string | undefined = undefined;
|
|
176
|
+
switch (inlineValue.type) {
|
|
177
|
+
case 'text':
|
|
178
|
+
text = inlineValue.text;
|
|
179
|
+
break;
|
|
180
|
+
case 'variable': {
|
|
181
|
+
let varName = inlineValue.variableName;
|
|
182
|
+
if (!varName) {
|
|
183
|
+
const lineContent = model.getLineContent(inlineValue.range.startLineNumber);
|
|
184
|
+
varName = lineContent.substring(inlineValue.range.startColumn - 1, inlineValue.range.endColumn - 1);
|
|
185
|
+
}
|
|
186
|
+
const variable = await findVariable(varName, inlineValue.caseSensitiveLookup);
|
|
187
|
+
if (variable) {
|
|
188
|
+
text = this.formatInlineValue(varName, variable.value);
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
case 'expression': {
|
|
193
|
+
let expr = inlineValue.expression;
|
|
194
|
+
if (!expr) {
|
|
195
|
+
const lineContent = model.getLineContent(inlineValue.range.startLineNumber);
|
|
196
|
+
expr = lineContent.substring(inlineValue.range.startColumn - 1, inlineValue.range.endColumn - 1);
|
|
197
|
+
}
|
|
198
|
+
if (expr) {
|
|
199
|
+
const expression = new ExpressionItem(expr, () => stackFrame.thread.session);
|
|
200
|
+
await expression.evaluate('watch');
|
|
201
|
+
if (expression.available) {
|
|
202
|
+
text = this.formatInlineValue(expr, expression.value);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
139
208
|
|
|
140
|
-
|
|
141
|
-
|
|
209
|
+
if (text) {
|
|
210
|
+
const line = inlineValue.range.startLineNumber;
|
|
211
|
+
let lineSegments = lineDecorations.get(line);
|
|
212
|
+
if (!lineSegments) {
|
|
213
|
+
lineSegments = [];
|
|
214
|
+
lineDecorations.set(line, lineSegments);
|
|
215
|
+
}
|
|
216
|
+
if (!lineSegments.some(segment => segment.text === text)) {
|
|
217
|
+
lineSegments.push(new InlineSegment(inlineValue.range.startColumn, text));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
142
220
|
}
|
|
143
221
|
}
|
|
144
222
|
}
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// sort line segments and concatenate them into a decoration
|
|
226
|
+
const separator = ', ';
|
|
227
|
+
lineDecorations.forEach((segments, line) => {
|
|
228
|
+
if (segments.length > 0) {
|
|
229
|
+
segments = segments.sort((a, b) => a.column - b.column);
|
|
230
|
+
const text = segments.map(s => s.text).join(separator);
|
|
231
|
+
decorations.push(this.createInlineValueDecoration(line, text));
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
} else { // use fallback if no provider was registered
|
|
236
|
+
const lineToNamesMap: Map<number, string[]> = new Map<number, string[]>();
|
|
237
|
+
const nameValueMap = new Map<string, string>();
|
|
238
|
+
for (const expr of expressions) {
|
|
239
|
+
if (expr instanceof DebugVariable) { // XXX: VS Code uses `IExpression` that has `name` and `value`.
|
|
240
|
+
nameValueMap.set(expr.name, expr.value);
|
|
241
|
+
}
|
|
242
|
+
// Limit the size of map. Too large can have a perf impact
|
|
243
|
+
if (nameValueMap.size >= MAX_NUM_INLINE_VALUES) {
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
145
246
|
}
|
|
146
|
-
});
|
|
147
247
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
248
|
+
const wordToPositionsMap = this.getWordToPositionsMap(model);
|
|
249
|
+
|
|
250
|
+
// Compute unique set of names on each line
|
|
251
|
+
nameValueMap.forEach((_, name) => {
|
|
252
|
+
const positions = wordToPositionsMap.get(name);
|
|
253
|
+
if (positions) {
|
|
254
|
+
for (const position of positions) {
|
|
255
|
+
if (range.containsPosition(position)) {
|
|
256
|
+
if (!lineToNamesMap.has(position.lineNumber)) {
|
|
257
|
+
lineToNamesMap.set(position.lineNumber, []);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (lineToNamesMap.get(position.lineNumber)!.indexOf(name) === -1) {
|
|
261
|
+
lineToNamesMap.get(position.lineNumber)!.push(name);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
// Compute decorators for each line
|
|
269
|
+
lineToNamesMap.forEach((names, line) => {
|
|
270
|
+
const contentText = names.sort((first, second) => {
|
|
271
|
+
const content = model.getLineContent(line);
|
|
272
|
+
return content.indexOf(first) - content.indexOf(second);
|
|
273
|
+
}).map(name => `${name} = ${nameValueMap.get(name)}`).join(', ');
|
|
274
|
+
decorations.push(this.createInlineValueDecoration(line, contentText));
|
|
275
|
+
});
|
|
276
|
+
}
|
|
157
277
|
|
|
158
278
|
return decorations;
|
|
159
279
|
}
|
|
160
280
|
|
|
281
|
+
protected formatInlineValue(...args: string[]): string {
|
|
282
|
+
const valuePattern = '{0} = {1}';
|
|
283
|
+
const formatRegExp = /{(\d+)}/g;
|
|
284
|
+
if (args.length === 0) {
|
|
285
|
+
return valuePattern;
|
|
286
|
+
}
|
|
287
|
+
return valuePattern.replace(formatRegExp, (match, group) => {
|
|
288
|
+
const idx = parseInt(group, 10);
|
|
289
|
+
return isNaN(idx) || idx < 0 || idx >= args.length ?
|
|
290
|
+
match :
|
|
291
|
+
args[idx];
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
|
|
161
295
|
// https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L454-L485
|
|
162
296
|
private createInlineValueDecoration(lineNumber: number, contentText: string): IDecorationOptions {
|
|
163
297
|
// If decoratorText is too long, trim and add ellipses. This could happen for minified files with everything on a single line
|