@codingame/monaco-vscode-debug-service-override 3.2.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/debug.js +4 -4
- package/package.json +2 -2
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/external/tslib/tslib.es6.js +0 -11
- package/override/vs/platform/dialogs/common/dialogs.js +0 -8
- package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +0 -73
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +0 -1011
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +0 -970
- package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +0 -347
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +0 -324
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +0 -432
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +0 -1039
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +0 -649
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +0 -64
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +0 -636
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +0 -725
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +0 -398
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +0 -206
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +0 -80
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +0 -169
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +0 -1271
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +0 -1305
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +0 -115
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +0 -77
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +0 -307
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +0 -31
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +0 -378
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +0 -267
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +0 -808
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +0 -121
- package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +0 -141
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +0 -262
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +0 -669
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +0 -709
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +0 -992
- package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +0 -48
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +0 -348
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +0 -119
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +0 -763
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +0 -501
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +0 -162
- package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +0 -21
- package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +0 -17
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +0 -110
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +0 -62
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +0 -460
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +0 -162
- package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +0 -36
- package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +0 -148
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +0 -289
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +0 -87
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +0 -64
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +0 -311
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +0 -28
|
@@ -1,725 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { addDisposableListener, isKeyboardEvent } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
-
import { DomEmitter } from 'vscode/vscode/vs/base/browser/event';
|
|
4
|
-
import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
|
|
5
|
-
import { flatten, distinct } from 'vscode/vscode/vs/base/common/arrays';
|
|
6
|
-
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
7
|
-
import { CancellationToken, CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
8
|
-
import { memoize } from 'vscode/vscode/vs/base/common/decorators';
|
|
9
|
-
import { illegalArgument, onUnexpectedExternalError } from 'vscode/vscode/vs/base/common/errors';
|
|
10
|
-
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
11
|
-
import { visit } from 'vscode/vscode/vs/base/common/json';
|
|
12
|
-
import { setProperty } from 'vscode/vscode/vs/base/common/jsonEdit';
|
|
13
|
-
import { MutableDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
14
|
-
import { clamp } from 'vscode/vscode/vs/base/common/numbers';
|
|
15
|
-
import { basename } from 'vscode/vscode/vs/base/common/path';
|
|
16
|
-
import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
|
|
17
|
-
import { format, noBreakWhitespace } from 'vscode/vscode/vs/base/common/strings';
|
|
18
|
-
import { assertType, isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
19
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
20
|
-
import { CoreEditingCommands } from 'vscode/vscode/vs/editor/browser/coreCommands';
|
|
21
|
-
import { EditOperation } from 'vscode/vscode/vs/editor/common/core/editOperation';
|
|
22
|
-
import { Position } from 'vscode/vscode/vs/editor/common/core/position';
|
|
23
|
-
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
24
|
-
import { DEFAULT_WORD_REGEXP } from 'vscode/vscode/vs/editor/common/core/wordHelper';
|
|
25
|
-
import { InjectedTextCursorStops } from 'vscode/vscode/vs/editor/common/model';
|
|
26
|
-
import { ILanguageFeatureDebounceService } from 'vscode/vscode/vs/editor/common/services/languageFeatureDebounce';
|
|
27
|
-
import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
|
|
28
|
-
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
29
|
-
import { HoverController } from 'vscode/vscode/vs/editor/contrib/hover/browser/hover';
|
|
30
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
31
|
-
import { CommandsRegistry, ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
32
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
33
|
-
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
34
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
35
|
-
import { registerColor } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
36
|
-
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
37
|
-
import { DebugHoverWidget } from './debugHover.js';
|
|
38
|
-
import { ExceptionWidget } from './exceptionWidget.js';
|
|
39
|
-
import { CONTEXT_EXCEPTION_WIDGET_VISIBLE, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
40
|
-
import { Expression } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
|
|
41
|
-
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
42
|
-
|
|
43
|
-
const MAX_NUM_INLINE_VALUES = 100;
|
|
44
|
-
const MAX_INLINE_DECORATOR_LENGTH = 150;
|
|
45
|
-
const MAX_TOKENIZATION_LINE_LEN = 500;
|
|
46
|
-
const DEAFULT_INLINE_DEBOUNCE_DELAY = 200;
|
|
47
|
-
registerColor('editor.inlineValuesForeground', {
|
|
48
|
-
dark: '#ffffff80',
|
|
49
|
-
light: '#00000080',
|
|
50
|
-
hcDark: '#ffffff80',
|
|
51
|
-
hcLight: '#00000080'
|
|
52
|
-
}, ( localizeWithPath(
|
|
53
|
-
'vs/workbench/contrib/debug/browser/debugEditorContribution',
|
|
54
|
-
'editor.inlineValuesForeground',
|
|
55
|
-
"Color for the debug inline value text."
|
|
56
|
-
)));
|
|
57
|
-
registerColor('editor.inlineValuesBackground', {
|
|
58
|
-
dark: '#ffc80033',
|
|
59
|
-
light: '#ffc80033',
|
|
60
|
-
hcDark: '#ffc80033',
|
|
61
|
-
hcLight: '#ffc80033'
|
|
62
|
-
}, ( localizeWithPath(
|
|
63
|
-
'vs/workbench/contrib/debug/browser/debugEditorContribution',
|
|
64
|
-
'editor.inlineValuesBackground',
|
|
65
|
-
"Color for the debug inline value background."
|
|
66
|
-
)));
|
|
67
|
-
class InlineSegment {
|
|
68
|
-
constructor(column, text) {
|
|
69
|
-
this.column = column;
|
|
70
|
-
this.text = text;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function createInlineValueDecoration(lineNumber, contentText, column = 1073741824 ) {
|
|
74
|
-
if (contentText.length > MAX_INLINE_DECORATOR_LENGTH) {
|
|
75
|
-
contentText = contentText.substring(0, MAX_INLINE_DECORATOR_LENGTH) + '...';
|
|
76
|
-
}
|
|
77
|
-
return [
|
|
78
|
-
{
|
|
79
|
-
range: {
|
|
80
|
-
startLineNumber: lineNumber,
|
|
81
|
-
endLineNumber: lineNumber,
|
|
82
|
-
startColumn: column,
|
|
83
|
-
endColumn: column
|
|
84
|
-
},
|
|
85
|
-
options: {
|
|
86
|
-
description: 'debug-inline-value-decoration-spacer',
|
|
87
|
-
after: {
|
|
88
|
-
content: noBreakWhitespace,
|
|
89
|
-
cursorStops: InjectedTextCursorStops.None
|
|
90
|
-
},
|
|
91
|
-
showIfCollapsed: true,
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
range: {
|
|
96
|
-
startLineNumber: lineNumber,
|
|
97
|
-
endLineNumber: lineNumber,
|
|
98
|
-
startColumn: column,
|
|
99
|
-
endColumn: column
|
|
100
|
-
},
|
|
101
|
-
options: {
|
|
102
|
-
description: 'debug-inline-value-decoration',
|
|
103
|
-
after: {
|
|
104
|
-
content: replaceWsWithNoBreakWs(contentText),
|
|
105
|
-
inlineClassName: 'debug-inline-value',
|
|
106
|
-
inlineClassNameAffectsLetterSpacing: true,
|
|
107
|
-
cursorStops: InjectedTextCursorStops.None
|
|
108
|
-
},
|
|
109
|
-
showIfCollapsed: true,
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
];
|
|
113
|
-
}
|
|
114
|
-
function replaceWsWithNoBreakWs(str) {
|
|
115
|
-
return str.replace(/[ \t]/g, noBreakWhitespace);
|
|
116
|
-
}
|
|
117
|
-
function createInlineValueDecorationsInsideRange(expressions, ranges, model, wordToLineNumbersMap) {
|
|
118
|
-
const nameValueMap = ( new Map());
|
|
119
|
-
for (const expr of expressions) {
|
|
120
|
-
nameValueMap.set(expr.name, expr.value);
|
|
121
|
-
if (nameValueMap.size >= MAX_NUM_INLINE_VALUES) {
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
const lineToNamesMap = ( new Map());
|
|
126
|
-
nameValueMap.forEach((_value, name) => {
|
|
127
|
-
const lineNumbers = wordToLineNumbersMap.get(name);
|
|
128
|
-
if (lineNumbers) {
|
|
129
|
-
for (const lineNumber of lineNumbers) {
|
|
130
|
-
if (( ranges.some(r => lineNumber >= r.startLineNumber && lineNumber <= r.endLineNumber))) {
|
|
131
|
-
if (!( lineToNamesMap.has(lineNumber))) {
|
|
132
|
-
lineToNamesMap.set(lineNumber, []);
|
|
133
|
-
}
|
|
134
|
-
if (lineToNamesMap.get(lineNumber).indexOf(name) === -1) {
|
|
135
|
-
lineToNamesMap.get(lineNumber).push(name);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
const decorations = [];
|
|
142
|
-
lineToNamesMap.forEach((names, line) => {
|
|
143
|
-
const contentText = ( names.sort((first, second) => {
|
|
144
|
-
const content = model.getLineContent(line);
|
|
145
|
-
return content.indexOf(first) - content.indexOf(second);
|
|
146
|
-
}).map(name => `${name} = ${nameValueMap.get(name)}`)).join(', ');
|
|
147
|
-
decorations.push(...createInlineValueDecoration(line, contentText));
|
|
148
|
-
});
|
|
149
|
-
return decorations;
|
|
150
|
-
}
|
|
151
|
-
function getWordToLineNumbersMap(model, lineNumber, result) {
|
|
152
|
-
const lineLength = model.getLineLength(lineNumber);
|
|
153
|
-
if (lineLength > MAX_TOKENIZATION_LINE_LEN) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const lineContent = model.getLineContent(lineNumber);
|
|
157
|
-
model.tokenization.forceTokenization(lineNumber);
|
|
158
|
-
const lineTokens = model.tokenization.getLineTokens(lineNumber);
|
|
159
|
-
for (let tokenIndex = 0, tokenCount = lineTokens.getCount(); tokenIndex < tokenCount; tokenIndex++) {
|
|
160
|
-
const tokenType = lineTokens.getStandardTokenType(tokenIndex);
|
|
161
|
-
if (tokenType === 0 ) {
|
|
162
|
-
DEFAULT_WORD_REGEXP.lastIndex = 0;
|
|
163
|
-
const tokenStartOffset = lineTokens.getStartOffset(tokenIndex);
|
|
164
|
-
const tokenEndOffset = lineTokens.getEndOffset(tokenIndex);
|
|
165
|
-
const tokenStr = lineContent.substring(tokenStartOffset, tokenEndOffset);
|
|
166
|
-
const wordMatch = DEFAULT_WORD_REGEXP.exec(tokenStr);
|
|
167
|
-
if (wordMatch) {
|
|
168
|
-
const word = wordMatch[0];
|
|
169
|
-
if (!( result.has(word))) {
|
|
170
|
-
result.set(word, []);
|
|
171
|
-
}
|
|
172
|
-
result.get(word).push(lineNumber);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
let DebugEditorContribution = class DebugEditorContribution {
|
|
178
|
-
constructor(editor, debugService, instantiationService, commandService, configurationService, hostService, uriIdentityService, contextKeyService, languageFeaturesService, featureDebounceService) {
|
|
179
|
-
this.editor = editor;
|
|
180
|
-
this.debugService = debugService;
|
|
181
|
-
this.instantiationService = instantiationService;
|
|
182
|
-
this.commandService = commandService;
|
|
183
|
-
this.configurationService = configurationService;
|
|
184
|
-
this.hostService = hostService;
|
|
185
|
-
this.uriIdentityService = uriIdentityService;
|
|
186
|
-
this.languageFeaturesService = languageFeaturesService;
|
|
187
|
-
this.hoverPosition = null;
|
|
188
|
-
this.mouseDown = false;
|
|
189
|
-
this.gutterIsHovered = false;
|
|
190
|
-
this.altListener = ( new MutableDisposable());
|
|
191
|
-
this.altPressed = false;
|
|
192
|
-
this.oldDecorations = this.editor.createDecorationsCollection();
|
|
193
|
-
this.defaultHoverLockout = ( new MutableDisposable());
|
|
194
|
-
this.debounceInfo = featureDebounceService.for(languageFeaturesService.inlineValuesProvider, 'InlineValues', { min: DEAFULT_INLINE_DEBOUNCE_DELAY });
|
|
195
|
-
this.hoverWidget = this.instantiationService.createInstance(DebugHoverWidget, this.editor);
|
|
196
|
-
this.toDispose = [this.defaultHoverLockout, this.altListener];
|
|
197
|
-
this.registerListeners();
|
|
198
|
-
this.exceptionWidgetVisible = CONTEXT_EXCEPTION_WIDGET_VISIBLE.bindTo(contextKeyService);
|
|
199
|
-
this.toggleExceptionWidget();
|
|
200
|
-
}
|
|
201
|
-
registerListeners() {
|
|
202
|
-
this.toDispose.push(this.debugService.getViewModel().onDidFocusStackFrame(e => this.onFocusStackFrame(e.stackFrame)));
|
|
203
|
-
this.toDispose.push(this.editor.onMouseDown((e) => this.onEditorMouseDown(e)));
|
|
204
|
-
this.toDispose.push(this.editor.onMouseUp(() => this.mouseDown = false));
|
|
205
|
-
this.toDispose.push(this.editor.onMouseMove((e) => this.onEditorMouseMove(e)));
|
|
206
|
-
this.toDispose.push(this.editor.onMouseLeave((e) => {
|
|
207
|
-
const hoverDomNode = this.hoverWidget.getDomNode();
|
|
208
|
-
if (!hoverDomNode) {
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
const rect = hoverDomNode.getBoundingClientRect();
|
|
212
|
-
if (e.event.posx < rect.left || e.event.posx > rect.right || e.event.posy < rect.top || e.event.posy > rect.bottom) {
|
|
213
|
-
this.hideHoverWidget();
|
|
214
|
-
}
|
|
215
|
-
}));
|
|
216
|
-
this.toDispose.push(this.editor.onKeyDown((e) => this.onKeyDown(e)));
|
|
217
|
-
this.toDispose.push(this.editor.onDidChangeModelContent(() => {
|
|
218
|
-
this._wordToLineNumbersMap = undefined;
|
|
219
|
-
this.updateInlineValuesScheduler.schedule();
|
|
220
|
-
}));
|
|
221
|
-
this.toDispose.push(this.debugService.getViewModel().onWillUpdateViews(() => this.updateInlineValuesScheduler.schedule()));
|
|
222
|
-
this.toDispose.push(this.debugService.getViewModel().onDidEvaluateLazyExpression(() => this.updateInlineValuesScheduler.schedule()));
|
|
223
|
-
this.toDispose.push(this.editor.onDidChangeModel(async () => {
|
|
224
|
-
this.addDocumentListeners();
|
|
225
|
-
this.toggleExceptionWidget();
|
|
226
|
-
this.hideHoverWidget();
|
|
227
|
-
this._wordToLineNumbersMap = undefined;
|
|
228
|
-
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
|
|
229
|
-
await this.updateInlineValueDecorations(stackFrame);
|
|
230
|
-
}));
|
|
231
|
-
this.toDispose.push(this.editor.onDidScrollChange(() => {
|
|
232
|
-
this.hideHoverWidget();
|
|
233
|
-
const model = this.editor.getModel();
|
|
234
|
-
if (model && ( this.languageFeaturesService.inlineValuesProvider.has(model))) {
|
|
235
|
-
this.updateInlineValuesScheduler.schedule();
|
|
236
|
-
}
|
|
237
|
-
}));
|
|
238
|
-
this.toDispose.push(this.configurationService.onDidChangeConfiguration((e) => {
|
|
239
|
-
if (e.affectsConfiguration('editor.hover')) {
|
|
240
|
-
this.updateHoverConfiguration();
|
|
241
|
-
}
|
|
242
|
-
}));
|
|
243
|
-
this.toDispose.push(this.debugService.onDidChangeState((state) => {
|
|
244
|
-
if (state !== 2 ) {
|
|
245
|
-
this.toggleExceptionWidget();
|
|
246
|
-
}
|
|
247
|
-
}));
|
|
248
|
-
this.updateHoverConfiguration();
|
|
249
|
-
}
|
|
250
|
-
updateHoverConfiguration() {
|
|
251
|
-
const model = this.editor.getModel();
|
|
252
|
-
if (model) {
|
|
253
|
-
this.editorHoverOptions = this.configurationService.getValue('editor.hover', {
|
|
254
|
-
resource: model.uri,
|
|
255
|
-
overrideIdentifier: model.getLanguageId()
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
addDocumentListeners() {
|
|
260
|
-
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
|
|
261
|
-
const model = this.editor.getModel();
|
|
262
|
-
if (model) {
|
|
263
|
-
this.applyDocumentListeners(model, stackFrame);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
applyDocumentListeners(model, stackFrame) {
|
|
267
|
-
if (!stackFrame || !this.uriIdentityService.extUri.isEqual(model.uri, stackFrame.source.uri)) {
|
|
268
|
-
this.altListener.clear();
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
const ownerDocument = this.editor.getContainerDomNode().ownerDocument;
|
|
272
|
-
this.altListener.value = addDisposableListener(ownerDocument, 'keydown', keydownEvent => {
|
|
273
|
-
const standardKeyboardEvent = ( new StandardKeyboardEvent(keydownEvent));
|
|
274
|
-
if (standardKeyboardEvent.keyCode === 6 ) {
|
|
275
|
-
this.altPressed = true;
|
|
276
|
-
const debugHoverWasVisible = this.hoverWidget.isVisible();
|
|
277
|
-
this.hoverWidget.hide();
|
|
278
|
-
this.defaultHoverLockout.clear();
|
|
279
|
-
if (debugHoverWasVisible && this.hoverPosition) {
|
|
280
|
-
this.showEditorHover(this.hoverPosition, false);
|
|
281
|
-
}
|
|
282
|
-
const onKeyUp = ( new DomEmitter(ownerDocument, 'keyup'));
|
|
283
|
-
const listener = Event.any(this.hostService.onDidChangeFocus, onKeyUp.event)(keyupEvent => {
|
|
284
|
-
let standardKeyboardEvent = undefined;
|
|
285
|
-
if (isKeyboardEvent(keyupEvent)) {
|
|
286
|
-
standardKeyboardEvent = ( new StandardKeyboardEvent(keyupEvent));
|
|
287
|
-
}
|
|
288
|
-
if (!standardKeyboardEvent || standardKeyboardEvent.keyCode === 6 ) {
|
|
289
|
-
this.altPressed = false;
|
|
290
|
-
this.preventDefaultEditorHover();
|
|
291
|
-
listener.dispose();
|
|
292
|
-
onKeyUp.dispose();
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
async showHover(position, focus) {
|
|
299
|
-
this.preventDefaultEditorHover();
|
|
300
|
-
const sf = this.debugService.getViewModel().focusedStackFrame;
|
|
301
|
-
const model = this.editor.getModel();
|
|
302
|
-
if (sf && model && this.uriIdentityService.extUri.isEqual(sf.source.uri, model.uri)) {
|
|
303
|
-
const result = await this.hoverWidget.showAt(position, focus);
|
|
304
|
-
if (result === 1 ) {
|
|
305
|
-
this.showEditorHover(position, focus);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
this.showEditorHover(position, focus);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
preventDefaultEditorHover() {
|
|
313
|
-
if (this.defaultHoverLockout.value || this.editorHoverOptions?.enabled === false) {
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
const hoverController = this.editor.getContribution(HoverController.ID);
|
|
317
|
-
hoverController?.hideContentHover();
|
|
318
|
-
this.editor.updateOptions({ hover: { enabled: false } });
|
|
319
|
-
this.defaultHoverLockout.value = {
|
|
320
|
-
dispose: () => {
|
|
321
|
-
this.editor.updateOptions({
|
|
322
|
-
hover: { enabled: this.editorHoverOptions?.enabled ?? true }
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
showEditorHover(position, focus) {
|
|
328
|
-
const hoverController = this.editor.getContribution(HoverController.ID);
|
|
329
|
-
const range = ( new Range(position.lineNumber, position.column, position.lineNumber, position.column));
|
|
330
|
-
this.defaultHoverLockout.clear();
|
|
331
|
-
hoverController?.showContentHover(range, 1 , 0 , focus);
|
|
332
|
-
}
|
|
333
|
-
async onFocusStackFrame(sf) {
|
|
334
|
-
const model = this.editor.getModel();
|
|
335
|
-
if (model) {
|
|
336
|
-
this.applyDocumentListeners(model, sf);
|
|
337
|
-
if (sf && this.uriIdentityService.extUri.isEqual(sf.source.uri, model.uri)) {
|
|
338
|
-
await this.toggleExceptionWidget();
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
this.hideHoverWidget();
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
await this.updateInlineValueDecorations(sf);
|
|
345
|
-
}
|
|
346
|
-
get hoverDelay() {
|
|
347
|
-
const baseDelay = this.editorHoverOptions?.delay || 0;
|
|
348
|
-
const delayFactor = clamp(2 - (baseDelay - 300) / 600, 1, 2);
|
|
349
|
-
return baseDelay * delayFactor;
|
|
350
|
-
}
|
|
351
|
-
get showHoverScheduler() {
|
|
352
|
-
const scheduler = ( new RunOnceScheduler(() => {
|
|
353
|
-
if (this.hoverPosition && !this.altPressed) {
|
|
354
|
-
this.showHover(this.hoverPosition, false);
|
|
355
|
-
}
|
|
356
|
-
}, this.hoverDelay));
|
|
357
|
-
this.toDispose.push(scheduler);
|
|
358
|
-
return scheduler;
|
|
359
|
-
}
|
|
360
|
-
hideHoverWidget() {
|
|
361
|
-
if (this.hoverWidget.willBeVisible()) {
|
|
362
|
-
this.hoverWidget.hide();
|
|
363
|
-
}
|
|
364
|
-
this.showHoverScheduler.cancel();
|
|
365
|
-
this.defaultHoverLockout.clear();
|
|
366
|
-
}
|
|
367
|
-
onEditorMouseDown(mouseEvent) {
|
|
368
|
-
this.mouseDown = true;
|
|
369
|
-
if (mouseEvent.target.type === 9 && mouseEvent.target.detail === DebugHoverWidget.ID) {
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
this.hideHoverWidget();
|
|
373
|
-
}
|
|
374
|
-
onEditorMouseMove(mouseEvent) {
|
|
375
|
-
if (this.debugService.state !== 2 ) {
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
const target = mouseEvent.target;
|
|
379
|
-
const stopKey = isMacintosh ? 'metaKey' : 'ctrlKey';
|
|
380
|
-
if (!this.altPressed) {
|
|
381
|
-
if (target.type === 2 ) {
|
|
382
|
-
this.defaultHoverLockout.clear();
|
|
383
|
-
this.gutterIsHovered = true;
|
|
384
|
-
}
|
|
385
|
-
else if (this.gutterIsHovered) {
|
|
386
|
-
this.gutterIsHovered = false;
|
|
387
|
-
this.updateHoverConfiguration();
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
if (target.type === 9 && target.detail === DebugHoverWidget.ID && !mouseEvent.event[stopKey]) {
|
|
391
|
-
const sticky = this.editorHoverOptions?.sticky ?? true;
|
|
392
|
-
if (sticky || this.hoverWidget.isShowingComplexValue) {
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
if (target.type === 6 ) {
|
|
397
|
-
if (target.position && !Position.equals(target.position, this.hoverPosition)) {
|
|
398
|
-
this.hoverPosition = target.position;
|
|
399
|
-
this.preventDefaultEditorHover();
|
|
400
|
-
this.showHoverScheduler.schedule(this.hoverDelay);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
else if (!this.mouseDown) {
|
|
404
|
-
this.hideHoverWidget();
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
onKeyDown(e) {
|
|
408
|
-
const stopKey = isMacintosh ? 57 : 5 ;
|
|
409
|
-
if (e.keyCode !== stopKey && e.keyCode !== 6 ) {
|
|
410
|
-
this.hideHoverWidget();
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
async toggleExceptionWidget() {
|
|
414
|
-
const model = this.editor.getModel();
|
|
415
|
-
const focusedSf = this.debugService.getViewModel().focusedStackFrame;
|
|
416
|
-
const callStack = focusedSf ? focusedSf.thread.getCallStack() : null;
|
|
417
|
-
if (!model || !focusedSf || !callStack || callStack.length === 0) {
|
|
418
|
-
this.closeExceptionWidget();
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
const exceptionSf = callStack.find(sf => !!(sf && sf.source && sf.source.available && sf.source.presentationHint !== 'deemphasize'));
|
|
422
|
-
if (!exceptionSf || exceptionSf !== focusedSf) {
|
|
423
|
-
this.closeExceptionWidget();
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
const sameUri = this.uriIdentityService.extUri.isEqual(exceptionSf.source.uri, model.uri);
|
|
427
|
-
if (this.exceptionWidget && !sameUri) {
|
|
428
|
-
this.closeExceptionWidget();
|
|
429
|
-
}
|
|
430
|
-
else if (sameUri) {
|
|
431
|
-
const exceptionInfo = await focusedSf.thread.exceptionInfo;
|
|
432
|
-
if (exceptionInfo) {
|
|
433
|
-
this.showExceptionWidget(exceptionInfo, this.debugService.getViewModel().focusedSession, exceptionSf.range.startLineNumber, exceptionSf.range.startColumn);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
showExceptionWidget(exceptionInfo, debugSession, lineNumber, column) {
|
|
438
|
-
if (this.exceptionWidget) {
|
|
439
|
-
this.exceptionWidget.dispose();
|
|
440
|
-
}
|
|
441
|
-
this.exceptionWidget = this.instantiationService.createInstance(ExceptionWidget, this.editor, exceptionInfo, debugSession);
|
|
442
|
-
this.exceptionWidget.show({ lineNumber, column }, 0);
|
|
443
|
-
this.exceptionWidget.focus();
|
|
444
|
-
this.editor.revealRangeInCenter({
|
|
445
|
-
startLineNumber: lineNumber,
|
|
446
|
-
startColumn: column,
|
|
447
|
-
endLineNumber: lineNumber,
|
|
448
|
-
endColumn: column,
|
|
449
|
-
});
|
|
450
|
-
this.exceptionWidgetVisible.set(true);
|
|
451
|
-
}
|
|
452
|
-
closeExceptionWidget() {
|
|
453
|
-
if (this.exceptionWidget) {
|
|
454
|
-
const shouldFocusEditor = this.exceptionWidget.hasFocus();
|
|
455
|
-
this.exceptionWidget.dispose();
|
|
456
|
-
this.exceptionWidget = undefined;
|
|
457
|
-
this.exceptionWidgetVisible.set(false);
|
|
458
|
-
if (shouldFocusEditor) {
|
|
459
|
-
this.editor.focus();
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
async addLaunchConfiguration() {
|
|
464
|
-
const model = this.editor.getModel();
|
|
465
|
-
if (!model) {
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
let configurationsArrayPosition;
|
|
469
|
-
let lastProperty;
|
|
470
|
-
const getConfigurationPosition = () => {
|
|
471
|
-
let depthInArray = 0;
|
|
472
|
-
visit(model.getValue(), {
|
|
473
|
-
onObjectProperty: (property) => {
|
|
474
|
-
lastProperty = property;
|
|
475
|
-
},
|
|
476
|
-
onArrayBegin: (offset) => {
|
|
477
|
-
if (lastProperty === 'configurations' && depthInArray === 0) {
|
|
478
|
-
configurationsArrayPosition = model.getPositionAt(offset + 1);
|
|
479
|
-
}
|
|
480
|
-
depthInArray++;
|
|
481
|
-
},
|
|
482
|
-
onArrayEnd: () => {
|
|
483
|
-
depthInArray--;
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
};
|
|
487
|
-
getConfigurationPosition();
|
|
488
|
-
if (!configurationsArrayPosition) {
|
|
489
|
-
const { tabSize, insertSpaces } = model.getOptions();
|
|
490
|
-
const eol = model.getEOL();
|
|
491
|
-
const edit = (basename(model.uri.fsPath) === 'launch.json') ?
|
|
492
|
-
setProperty(model.getValue(), ['configurations'], [], { tabSize, insertSpaces, eol })[0] :
|
|
493
|
-
setProperty(model.getValue(), ['launch'], { 'configurations': [] }, { tabSize, insertSpaces, eol })[0];
|
|
494
|
-
const startPosition = model.getPositionAt(edit.offset);
|
|
495
|
-
const lineNumber = startPosition.lineNumber;
|
|
496
|
-
const range = ( new Range(
|
|
497
|
-
lineNumber,
|
|
498
|
-
startPosition.column,
|
|
499
|
-
lineNumber,
|
|
500
|
-
model.getLineMaxColumn(lineNumber)
|
|
501
|
-
));
|
|
502
|
-
model.pushEditOperations(null, [EditOperation.replace(range, edit.content)], () => null);
|
|
503
|
-
getConfigurationPosition();
|
|
504
|
-
}
|
|
505
|
-
if (!configurationsArrayPosition) {
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
this.editor.focus();
|
|
509
|
-
const insertLine = (position) => {
|
|
510
|
-
if (model.getLineLastNonWhitespaceColumn(position.lineNumber) > position.column) {
|
|
511
|
-
this.editor.setPosition(position);
|
|
512
|
-
CoreEditingCommands.LineBreakInsert.runEditorCommand(null, this.editor, null);
|
|
513
|
-
}
|
|
514
|
-
this.editor.setPosition(position);
|
|
515
|
-
return this.commandService.executeCommand('editor.action.insertLineAfter');
|
|
516
|
-
};
|
|
517
|
-
await insertLine(configurationsArrayPosition);
|
|
518
|
-
await this.commandService.executeCommand('editor.action.triggerSuggest');
|
|
519
|
-
}
|
|
520
|
-
get removeInlineValuesScheduler() {
|
|
521
|
-
return ( new RunOnceScheduler(() => {
|
|
522
|
-
this.oldDecorations.clear();
|
|
523
|
-
}, 100));
|
|
524
|
-
}
|
|
525
|
-
get updateInlineValuesScheduler() {
|
|
526
|
-
const model = this.editor.getModel();
|
|
527
|
-
return ( new RunOnceScheduler(
|
|
528
|
-
async () => await this.updateInlineValueDecorations(this.debugService.getViewModel().focusedStackFrame),
|
|
529
|
-
model ? this.debounceInfo.get(model) : DEAFULT_INLINE_DEBOUNCE_DELAY
|
|
530
|
-
));
|
|
531
|
-
}
|
|
532
|
-
async updateInlineValueDecorations(stackFrame) {
|
|
533
|
-
const var_value_format = '{0} = {1}';
|
|
534
|
-
const separator = ', ';
|
|
535
|
-
const model = this.editor.getModel();
|
|
536
|
-
const inlineValuesSetting = this.configurationService.getValue('debug').inlineValues;
|
|
537
|
-
const inlineValuesTurnedOn = inlineValuesSetting === true || inlineValuesSetting === 'on' || (inlineValuesSetting === 'auto' && model && ( this.languageFeaturesService.inlineValuesProvider.has(model)));
|
|
538
|
-
if (!inlineValuesTurnedOn || !model || !stackFrame || ( model.uri.toString()) !== ( stackFrame.source.uri.toString())) {
|
|
539
|
-
if (!this.removeInlineValuesScheduler.isScheduled()) {
|
|
540
|
-
this.removeInlineValuesScheduler.schedule();
|
|
541
|
-
}
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
this.removeInlineValuesScheduler.cancel();
|
|
545
|
-
const viewRanges = this.editor.getVisibleRangesPlusViewportAboveBelow();
|
|
546
|
-
let allDecorations;
|
|
547
|
-
if (( this.languageFeaturesService.inlineValuesProvider.has(model))) {
|
|
548
|
-
const findVariable = async (_key, caseSensitiveLookup) => {
|
|
549
|
-
const scopes = await stackFrame.getMostSpecificScopes(stackFrame.range);
|
|
550
|
-
const key = caseSensitiveLookup ? _key : _key.toLowerCase();
|
|
551
|
-
for (const scope of scopes) {
|
|
552
|
-
const variables = await scope.getChildren();
|
|
553
|
-
const found = variables.find(v => caseSensitiveLookup ? (v.name === key) : (v.name.toLowerCase() === key));
|
|
554
|
-
if (found) {
|
|
555
|
-
return found.value;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
return undefined;
|
|
559
|
-
};
|
|
560
|
-
const ctx = {
|
|
561
|
-
frameId: stackFrame.frameId,
|
|
562
|
-
stoppedLocation: ( new Range(
|
|
563
|
-
stackFrame.range.startLineNumber,
|
|
564
|
-
stackFrame.range.startColumn + 1,
|
|
565
|
-
stackFrame.range.endLineNumber,
|
|
566
|
-
stackFrame.range.endColumn + 1
|
|
567
|
-
))
|
|
568
|
-
};
|
|
569
|
-
const token = ( new CancellationTokenSource()).token;
|
|
570
|
-
const providers = this.languageFeaturesService.inlineValuesProvider.ordered(model).reverse();
|
|
571
|
-
allDecorations = [];
|
|
572
|
-
const lineDecorations = ( new Map());
|
|
573
|
-
const promises = flatten(( providers.map(provider => ( viewRanges.map(
|
|
574
|
-
range => Promise.resolve(provider.provideInlineValues(model, range, ctx, token)).then(async (result) => {
|
|
575
|
-
if (result) {
|
|
576
|
-
for (const iv of result) {
|
|
577
|
-
let text = undefined;
|
|
578
|
-
switch (iv.type) {
|
|
579
|
-
case 'text':
|
|
580
|
-
text = iv.text;
|
|
581
|
-
break;
|
|
582
|
-
case 'variable': {
|
|
583
|
-
let va = iv.variableName;
|
|
584
|
-
if (!va) {
|
|
585
|
-
const lineContent = model.getLineContent(iv.range.startLineNumber);
|
|
586
|
-
va = lineContent.substring(iv.range.startColumn - 1, iv.range.endColumn - 1);
|
|
587
|
-
}
|
|
588
|
-
const value = await findVariable(va, iv.caseSensitiveLookup);
|
|
589
|
-
if (value) {
|
|
590
|
-
text = format(var_value_format, va, value);
|
|
591
|
-
}
|
|
592
|
-
break;
|
|
593
|
-
}
|
|
594
|
-
case 'expression': {
|
|
595
|
-
let expr = iv.expression;
|
|
596
|
-
if (!expr) {
|
|
597
|
-
const lineContent = model.getLineContent(iv.range.startLineNumber);
|
|
598
|
-
expr = lineContent.substring(iv.range.startColumn - 1, iv.range.endColumn - 1);
|
|
599
|
-
}
|
|
600
|
-
if (expr) {
|
|
601
|
-
const expression = ( new Expression(expr));
|
|
602
|
-
await expression.evaluate(stackFrame.thread.session, stackFrame, 'watch', true);
|
|
603
|
-
if (expression.available) {
|
|
604
|
-
text = format(var_value_format, expr, expression.value);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
break;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
if (text) {
|
|
611
|
-
const line = iv.range.startLineNumber;
|
|
612
|
-
let lineSegments = lineDecorations.get(line);
|
|
613
|
-
if (!lineSegments) {
|
|
614
|
-
lineSegments = [];
|
|
615
|
-
lineDecorations.set(line, lineSegments);
|
|
616
|
-
}
|
|
617
|
-
if (!( lineSegments.some(iv => iv.text === text))) {
|
|
618
|
-
lineSegments.push(( new InlineSegment(iv.range.startColumn, text)));
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
}, err => {
|
|
624
|
-
onUnexpectedExternalError(err);
|
|
625
|
-
})
|
|
626
|
-
)))));
|
|
627
|
-
const startTime = Date.now();
|
|
628
|
-
await Promise.all(promises);
|
|
629
|
-
this.updateInlineValuesScheduler.delay = this.debounceInfo.update(model, Date.now() - startTime);
|
|
630
|
-
lineDecorations.forEach((segments, line) => {
|
|
631
|
-
if (segments.length > 0) {
|
|
632
|
-
segments = segments.sort((a, b) => a.column - b.column);
|
|
633
|
-
const text = ( segments.map(s => s.text)).join(separator);
|
|
634
|
-
allDecorations.push(...createInlineValueDecoration(line, text));
|
|
635
|
-
}
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
else {
|
|
639
|
-
const scopes = await stackFrame.getMostSpecificScopes(stackFrame.range);
|
|
640
|
-
const decorationsPerScope = await Promise.all(( scopes.map(async (scope) => {
|
|
641
|
-
const variables = await scope.getChildren();
|
|
642
|
-
let scopeRange = ( new Range(0, 0, stackFrame.range.startLineNumber, stackFrame.range.startColumn));
|
|
643
|
-
if (scope.range) {
|
|
644
|
-
scopeRange = scopeRange.setStartPosition(scope.range.startLineNumber, scope.range.startColumn);
|
|
645
|
-
}
|
|
646
|
-
const ownRanges = ( viewRanges.map(r => r.intersectRanges(scopeRange))).filter(isDefined);
|
|
647
|
-
this._wordToLineNumbersMap ??= ( new WordsToLineNumbersCache(model));
|
|
648
|
-
for (const range of ownRanges) {
|
|
649
|
-
this._wordToLineNumbersMap.ensureRangePopulated(range);
|
|
650
|
-
}
|
|
651
|
-
return createInlineValueDecorationsInsideRange(variables, ownRanges, model, this._wordToLineNumbersMap.value);
|
|
652
|
-
})));
|
|
653
|
-
allDecorations = distinct(decorationsPerScope.reduce((previous, current) => previous.concat(current), []),
|
|
654
|
-
decoration => `${decoration.range.startLineNumber}:${decoration?.options.after?.content}`);
|
|
655
|
-
}
|
|
656
|
-
this.oldDecorations.set(allDecorations);
|
|
657
|
-
}
|
|
658
|
-
dispose() {
|
|
659
|
-
if (this.hoverWidget) {
|
|
660
|
-
this.hoverWidget.dispose();
|
|
661
|
-
}
|
|
662
|
-
if (this.configurationWidget) {
|
|
663
|
-
this.configurationWidget.dispose();
|
|
664
|
-
}
|
|
665
|
-
this.toDispose = dispose(this.toDispose);
|
|
666
|
-
this.oldDecorations.clear();
|
|
667
|
-
}
|
|
668
|
-
};
|
|
669
|
-
DebugEditorContribution.__decorator = ( __decorate([
|
|
670
|
-
memoize
|
|
671
|
-
], DebugEditorContribution.prototype, "showHoverScheduler", null));
|
|
672
|
-
DebugEditorContribution.__decorator = ( __decorate([
|
|
673
|
-
memoize
|
|
674
|
-
], DebugEditorContribution.prototype, "removeInlineValuesScheduler", null));
|
|
675
|
-
DebugEditorContribution.__decorator = ( __decorate([
|
|
676
|
-
memoize
|
|
677
|
-
], DebugEditorContribution.prototype, "updateInlineValuesScheduler", null));
|
|
678
|
-
DebugEditorContribution = ( __decorate([
|
|
679
|
-
( __param(1, IDebugService)),
|
|
680
|
-
( __param(2, IInstantiationService)),
|
|
681
|
-
( __param(3, ICommandService)),
|
|
682
|
-
( __param(4, IConfigurationService)),
|
|
683
|
-
( __param(5, IHostService)),
|
|
684
|
-
( __param(6, IUriIdentityService)),
|
|
685
|
-
( __param(7, IContextKeyService)),
|
|
686
|
-
( __param(8, ILanguageFeaturesService)),
|
|
687
|
-
( __param(9, ILanguageFeatureDebounceService))
|
|
688
|
-
], DebugEditorContribution));
|
|
689
|
-
class WordsToLineNumbersCache {
|
|
690
|
-
constructor(model) {
|
|
691
|
-
this.model = model;
|
|
692
|
-
this.value = ( new Map());
|
|
693
|
-
this.intervals = ( new Uint8Array(Math.ceil(model.getLineCount() / 8)));
|
|
694
|
-
}
|
|
695
|
-
ensureRangePopulated(range) {
|
|
696
|
-
for (let lineNumber = range.startLineNumber; lineNumber <= range.endLineNumber; lineNumber++) {
|
|
697
|
-
const bin = lineNumber >> 3;
|
|
698
|
-
const bit = 1 << (lineNumber & 0b111);
|
|
699
|
-
if (!(this.intervals[bin] & bit)) {
|
|
700
|
-
getWordToLineNumbersMap(this.model, lineNumber, this.value);
|
|
701
|
-
this.intervals[bin] |= bit;
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
CommandsRegistry.registerCommand('_executeInlineValueProvider', async (accessor, uri, iRange, context) => {
|
|
707
|
-
assertType(URI.isUri(uri));
|
|
708
|
-
assertType(Range.isIRange(iRange));
|
|
709
|
-
if (!context || typeof context.frameId !== 'number' || !Range.isIRange(context.stoppedLocation)) {
|
|
710
|
-
throw illegalArgument('context');
|
|
711
|
-
}
|
|
712
|
-
const model = accessor.get(IModelService).getModel(uri);
|
|
713
|
-
if (!model) {
|
|
714
|
-
throw illegalArgument('uri');
|
|
715
|
-
}
|
|
716
|
-
const range = Range.lift(iRange);
|
|
717
|
-
const { inlineValuesProvider } = accessor.get(ILanguageFeaturesService);
|
|
718
|
-
const providers = inlineValuesProvider.ordered(model);
|
|
719
|
-
const providerResults = await Promise.all(( providers.map(
|
|
720
|
-
provider => provider.provideInlineValues(model, range, context, CancellationToken.None)
|
|
721
|
-
)));
|
|
722
|
-
return providerResults.flat().filter(isDefined);
|
|
723
|
-
});
|
|
724
|
-
|
|
725
|
-
export { DebugEditorContribution };
|