@codingame/monaco-vscode-debug-service-override 25.1.1 → 26.0.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/package.json +2 -2
- package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +41 -29
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +379 -255
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +606 -325
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +132 -91
- package/vscode/src/vs/workbench/contrib/debug/browser/debugChatIntegration.js +105 -103
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +258 -147
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +14 -10
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +163 -121
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +92 -41
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +13 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +68 -39
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +290 -214
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +409 -260
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSettingMigration.js +14 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +19 -21
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +126 -100
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +8 -9
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +160 -89
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +87 -71
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +270 -181
- package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +79 -48
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +149 -113
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css +24 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +201 -189
- package/vscode/src/vs/workbench/contrib/debug/browser/replAccessibilityHelp.js +28 -35
- package/vscode/src/vs/workbench/contrib/debug/browser/replAccessibleView.js +10 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/runAndDebugAccessibilityHelp.js +66 -86
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +24 -31
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +177 -138
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +55 -33
- package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +2 -4
- package/vscode/src/vs/workbench/contrib/debug/common/debugAccessibilityAnnouncer.js +8 -12
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +23 -19
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +9 -15
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +156 -133
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +81 -52
- package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +3 -5
- package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +22 -14
- package/vscode/src/vs/workbench/contrib/debug/common/debugVisualizers.js +46 -30
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +74 -52
- package/vscode/src/vs/workbench/contrib/debug/common/replAccessibilityAnnouncer.js +11 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +7 -7
|
@@ -42,8 +42,33 @@ let WatchExpressionsView = class WatchExpressionsView extends ViewPane {
|
|
|
42
42
|
get treeSelection() {
|
|
43
43
|
return this.tree.getSelection();
|
|
44
44
|
}
|
|
45
|
-
constructor(
|
|
46
|
-
|
|
45
|
+
constructor(
|
|
46
|
+
options,
|
|
47
|
+
contextMenuService,
|
|
48
|
+
debugService,
|
|
49
|
+
keybindingService,
|
|
50
|
+
instantiationService,
|
|
51
|
+
viewDescriptorService,
|
|
52
|
+
configurationService,
|
|
53
|
+
contextKeyService,
|
|
54
|
+
openerService,
|
|
55
|
+
themeService,
|
|
56
|
+
hoverService,
|
|
57
|
+
menuService,
|
|
58
|
+
logService
|
|
59
|
+
) {
|
|
60
|
+
super(
|
|
61
|
+
options,
|
|
62
|
+
keybindingService,
|
|
63
|
+
contextMenuService,
|
|
64
|
+
configurationService,
|
|
65
|
+
contextKeyService,
|
|
66
|
+
viewDescriptorService,
|
|
67
|
+
instantiationService,
|
|
68
|
+
openerService,
|
|
69
|
+
themeService,
|
|
70
|
+
hoverService
|
|
71
|
+
);
|
|
47
72
|
this.debugService = debugService;
|
|
48
73
|
this.menuService = menuService;
|
|
49
74
|
this.logService = logService;
|
|
@@ -58,19 +83,21 @@ let WatchExpressionsView = class WatchExpressionsView extends ViewPane {
|
|
|
58
83
|
}
|
|
59
84
|
renderBody(container) {
|
|
60
85
|
super.renderBody(container);
|
|
61
|
-
this.element.classList.add(
|
|
62
|
-
container.classList.add(
|
|
86
|
+
this.element.classList.add("debug-pane");
|
|
87
|
+
container.classList.add("debug-watch");
|
|
63
88
|
const treeContainer = renderViewTree(container);
|
|
64
89
|
const expressionsRenderer = this.instantiationService.createInstance(WatchExpressionsRenderer, this.expressionRenderer);
|
|
65
|
-
this.tree = this.instantiationService.createInstance(
|
|
90
|
+
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, "WatchExpressions", treeContainer, ( new WatchExpressionsDelegate()), [
|
|
66
91
|
expressionsRenderer,
|
|
67
92
|
this.instantiationService.createInstance(VariablesRenderer, this.expressionRenderer),
|
|
68
|
-
this.instantiationService.createInstance(VisualizedVariableRenderer, this.expressionRenderer)
|
|
93
|
+
this.instantiationService.createInstance(VisualizedVariableRenderer, this.expressionRenderer)
|
|
69
94
|
], this.instantiationService.createInstance(WatchExpressionsDataSource), {
|
|
70
95
|
accessibilityProvider: ( new WatchExpressionsAccessibilityProvider()),
|
|
71
|
-
identityProvider: {
|
|
96
|
+
identityProvider: {
|
|
97
|
+
getId: element => element.getId()
|
|
98
|
+
},
|
|
72
99
|
keyboardNavigationLabelProvider: {
|
|
73
|
-
getKeyboardNavigationLabel:
|
|
100
|
+
getKeyboardNavigationLabel: e => {
|
|
74
101
|
if (e === this.debugService.getViewModel().getSelectedExpression()?.expression) {
|
|
75
102
|
return undefined;
|
|
76
103
|
}
|
|
@@ -83,15 +110,16 @@ let WatchExpressionsView = class WatchExpressionsView extends ViewPane {
|
|
|
83
110
|
this._register(this.tree);
|
|
84
111
|
this.tree.setInput(this.debugService);
|
|
85
112
|
CONTEXT_WATCH_EXPRESSIONS_FOCUSED.bindTo(this.tree.contextKeyService);
|
|
86
|
-
this._register(
|
|
113
|
+
this._register(
|
|
114
|
+
VisualizedVariableRenderer.rendererOnVisualizationRange(this.debugService.getViewModel(), this.tree)
|
|
115
|
+
);
|
|
87
116
|
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
|
88
117
|
this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
|
|
89
|
-
this._register(this.debugService.getModel().onDidChangeWatchExpressions(async
|
|
118
|
+
this._register(this.debugService.getModel().onDidChangeWatchExpressions(async we => {
|
|
90
119
|
this.watchExpressionsExist.set(this.debugService.getModel().getWatchExpressions().length > 0);
|
|
91
120
|
if (!this.isBodyVisible()) {
|
|
92
121
|
this.needsRefresh = true;
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
122
|
+
} else {
|
|
95
123
|
if (we && !we.name) {
|
|
96
124
|
useCachedEvaluation = true;
|
|
97
125
|
}
|
|
@@ -127,18 +155,21 @@ let WatchExpressionsView = class WatchExpressionsView extends ViewPane {
|
|
|
127
155
|
if (expression && this.tree.hasNode(expression)) {
|
|
128
156
|
horizontalScrolling = this.tree.options.horizontalScrolling;
|
|
129
157
|
if (horizontalScrolling) {
|
|
130
|
-
this.tree.updateOptions({
|
|
158
|
+
this.tree.updateOptions({
|
|
159
|
+
horizontalScrolling: false
|
|
160
|
+
});
|
|
131
161
|
}
|
|
132
162
|
if (expression.name) {
|
|
133
163
|
this.tree.rerender(expression);
|
|
134
164
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
165
|
+
} else if (!expression && horizontalScrolling !== undefined) {
|
|
166
|
+
this.tree.updateOptions({
|
|
167
|
+
horizontalScrolling: horizontalScrolling
|
|
168
|
+
});
|
|
138
169
|
horizontalScrolling = undefined;
|
|
139
170
|
}
|
|
140
171
|
}));
|
|
141
|
-
this._register(this.debugService.getViewModel().onDidEvaluateLazyExpression(async
|
|
172
|
+
this._register(this.debugService.getViewModel().onDidEvaluateLazyExpression(async e => {
|
|
142
173
|
if (e instanceof Variable && this.tree.hasNode(e)) {
|
|
143
174
|
await this.tree.updateChildren(e, false, true);
|
|
144
175
|
await this.tree.expand(e);
|
|
@@ -157,15 +188,14 @@ let WatchExpressionsView = class WatchExpressionsView extends ViewPane {
|
|
|
157
188
|
this.tree.collapseAll();
|
|
158
189
|
}
|
|
159
190
|
onMouseDblClick(e) {
|
|
160
|
-
if (e.browserEvent.target.className.indexOf(
|
|
191
|
+
if (e.browserEvent.target.className.indexOf("twistie") >= 0) {
|
|
161
192
|
return;
|
|
162
193
|
}
|
|
163
194
|
const element = e.element;
|
|
164
195
|
const selectedExpression = this.debugService.getViewModel().getSelectedExpression();
|
|
165
196
|
if ((element instanceof Expression && element !== selectedExpression?.expression) || (element instanceof VisualizedExpression && element.treeItem.canEdit)) {
|
|
166
197
|
this.debugService.getViewModel().setSelectedExpression(element, false);
|
|
167
|
-
}
|
|
168
|
-
else if (!element) {
|
|
198
|
+
} else if (!element) {
|
|
169
199
|
this.debugService.addWatchExpression();
|
|
170
200
|
}
|
|
171
201
|
}
|
|
@@ -176,8 +206,13 @@ let WatchExpressionsView = class WatchExpressionsView extends ViewPane {
|
|
|
176
206
|
}
|
|
177
207
|
const selection = this.tree.getSelection();
|
|
178
208
|
const contextKeyService = element && (await getContextForWatchExpressionMenuWithDataAccess(this.contextKeyService, element, this.debugService, this.logService));
|
|
179
|
-
const menu = this.menuService.getMenuActions(MenuId.DebugWatchContext, contextKeyService, {
|
|
180
|
-
|
|
209
|
+
const menu = this.menuService.getMenuActions(MenuId.DebugWatchContext, contextKeyService, {
|
|
210
|
+
arg: element,
|
|
211
|
+
shouldForwardArgs: false
|
|
212
|
+
});
|
|
213
|
+
const {
|
|
214
|
+
secondary
|
|
215
|
+
} = getContextMenuActions(menu, "inline");
|
|
181
216
|
this.contextMenuService.showContextMenu({
|
|
182
217
|
getAnchor: () => e.anchor,
|
|
183
218
|
getActions: () => secondary,
|
|
@@ -185,20 +220,7 @@ let WatchExpressionsView = class WatchExpressionsView extends ViewPane {
|
|
|
185
220
|
});
|
|
186
221
|
}
|
|
187
222
|
};
|
|
188
|
-
WatchExpressionsView = ( __decorate([
|
|
189
|
-
( __param(1, IContextMenuService)),
|
|
190
|
-
( __param(2, IDebugService)),
|
|
191
|
-
( __param(3, IKeybindingService)),
|
|
192
|
-
( __param(4, IInstantiationService)),
|
|
193
|
-
( __param(5, IViewDescriptorService)),
|
|
194
|
-
( __param(6, IConfigurationService)),
|
|
195
|
-
( __param(7, IContextKeyService)),
|
|
196
|
-
( __param(8, IOpenerService)),
|
|
197
|
-
( __param(9, IThemeService)),
|
|
198
|
-
( __param(10, IHoverService)),
|
|
199
|
-
( __param(11, IMenuService)),
|
|
200
|
-
( __param(12, ILogService))
|
|
201
|
-
], WatchExpressionsView));
|
|
223
|
+
WatchExpressionsView = ( __decorate([( __param(1, IContextMenuService)), ( __param(2, IDebugService)), ( __param(3, IKeybindingService)), ( __param(4, IInstantiationService)), ( __param(5, IViewDescriptorService)), ( __param(6, IConfigurationService)), ( __param(7, IContextKeyService)), ( __param(8, IOpenerService)), ( __param(9, IThemeService)), ( __param(10, IHoverService)), ( __param(11, IMenuService)), ( __param(12, ILogService))], WatchExpressionsView));
|
|
202
224
|
class WatchExpressionsDelegate {
|
|
203
225
|
getHeight(_element) {
|
|
204
226
|
return 22;
|
|
@@ -214,7 +236,7 @@ class WatchExpressionsDelegate {
|
|
|
214
236
|
}
|
|
215
237
|
}
|
|
216
238
|
function isDebugService(element) {
|
|
217
|
-
return typeof element.getConfigurationManager ===
|
|
239
|
+
return typeof element.getConfigurationManager === "function";
|
|
218
240
|
}
|
|
219
241
|
class WatchExpressionsDataSource extends AbstractExpressionDataSource {
|
|
220
242
|
hasChildren(element) {
|
|
@@ -225,17 +247,29 @@ class WatchExpressionsDataSource extends AbstractExpressionDataSource {
|
|
|
225
247
|
const debugService = element;
|
|
226
248
|
const watchExpressions = debugService.getModel().getWatchExpressions();
|
|
227
249
|
const viewModel = debugService.getViewModel();
|
|
228
|
-
return Promise.all(( watchExpressions.map(
|
|
229
|
-
? we.evaluate(viewModel.focusedSession, viewModel.focusedStackFrame,
|
|
230
|
-
|
|
250
|
+
return Promise.all(( watchExpressions.map(
|
|
251
|
+
we => !!we.name && !useCachedEvaluation ? we.evaluate(viewModel.focusedSession, viewModel.focusedStackFrame, "watch").then(() => we) : Promise.resolve(we)
|
|
252
|
+
)));
|
|
231
253
|
}
|
|
232
254
|
return element.getChildren();
|
|
233
255
|
}
|
|
234
256
|
}
|
|
235
257
|
let WatchExpressionsRenderer = class WatchExpressionsRenderer extends AbstractExpressionsRenderer {
|
|
236
|
-
static {
|
|
237
|
-
|
|
238
|
-
|
|
258
|
+
static {
|
|
259
|
+
WatchExpressionsRenderer_1 = this;
|
|
260
|
+
}
|
|
261
|
+
static {
|
|
262
|
+
this.ID = "watchexpression";
|
|
263
|
+
}
|
|
264
|
+
constructor(
|
|
265
|
+
expressionRenderer,
|
|
266
|
+
menuService,
|
|
267
|
+
contextKeyService,
|
|
268
|
+
debugService,
|
|
269
|
+
contextViewService,
|
|
270
|
+
hoverService,
|
|
271
|
+
configurationService
|
|
272
|
+
) {
|
|
239
273
|
super(debugService, contextViewService, hoverService);
|
|
240
274
|
this.expressionRenderer = expressionRenderer;
|
|
241
275
|
this.menuService = menuService;
|
|
@@ -248,7 +282,7 @@ let WatchExpressionsRenderer = class WatchExpressionsRenderer extends AbstractEx
|
|
|
248
282
|
renderElement(node, index, data) {
|
|
249
283
|
data.elementDisposable.clear();
|
|
250
284
|
data.elementDisposable.add(this.configurationService.onDidChangeConfiguration(e => {
|
|
251
|
-
if (e.affectsConfiguration(
|
|
285
|
+
if (e.affectsConfiguration("debug.showVariableTypes")) {
|
|
252
286
|
super.renderExpressionElement(node.element, node, data);
|
|
253
287
|
}
|
|
254
288
|
}));
|
|
@@ -256,27 +290,22 @@ let WatchExpressionsRenderer = class WatchExpressionsRenderer extends AbstractEx
|
|
|
256
290
|
}
|
|
257
291
|
renderExpression(expression, data, highlights) {
|
|
258
292
|
let text;
|
|
259
|
-
data.type.textContent =
|
|
260
|
-
const showType = this.configurationService.getValue(
|
|
293
|
+
data.type.textContent = "";
|
|
294
|
+
const showType = this.configurationService.getValue("debug").showVariableTypes;
|
|
261
295
|
if (showType && expression.type) {
|
|
262
|
-
text = typeof expression.value ===
|
|
263
|
-
data.type.textContent = expression.type +
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
text = typeof expression.value === 'string' ? `${expression.name} =` : expression.name;
|
|
296
|
+
text = typeof expression.value === "string" ? `${expression.name}: ` : expression.name;
|
|
297
|
+
data.type.textContent = expression.type + " =";
|
|
298
|
+
} else {
|
|
299
|
+
text = typeof expression.value === "string" ? `${expression.name} =` : expression.name;
|
|
267
300
|
}
|
|
268
301
|
let title;
|
|
269
302
|
if (expression.type) {
|
|
270
303
|
if (showType) {
|
|
271
304
|
title = `${expression.name}`;
|
|
305
|
+
} else {
|
|
306
|
+
title = expression.type === expression.value ? expression.type : `${expression.type}`;
|
|
272
307
|
}
|
|
273
|
-
|
|
274
|
-
title = expression.type === expression.value ?
|
|
275
|
-
expression.type :
|
|
276
|
-
`${expression.type}`;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
308
|
+
} else {
|
|
280
309
|
title = expression.value;
|
|
281
310
|
}
|
|
282
311
|
data.label.set(text, highlights, title);
|
|
@@ -284,14 +313,14 @@ let WatchExpressionsRenderer = class WatchExpressionsRenderer extends AbstractEx
|
|
|
284
313
|
showChanged: true,
|
|
285
314
|
maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_VIEWLET,
|
|
286
315
|
colorize: true,
|
|
287
|
-
session: expression.getSession()
|
|
316
|
+
session: expression.getSession()
|
|
288
317
|
}));
|
|
289
318
|
}
|
|
290
319
|
getInputBoxOptions(expression, settingValue) {
|
|
291
320
|
if (settingValue) {
|
|
292
321
|
return {
|
|
293
322
|
initialValue: expression.value,
|
|
294
|
-
ariaLabel: ( localize(
|
|
323
|
+
ariaLabel: ( localize(7333, "Type new value")),
|
|
295
324
|
onFinish: async (value, success) => {
|
|
296
325
|
if (success && value) {
|
|
297
326
|
const focusedFrame = this.debugService.getViewModel().focusedStackFrame;
|
|
@@ -304,17 +333,16 @@ let WatchExpressionsRenderer = class WatchExpressionsRenderer extends AbstractEx
|
|
|
304
333
|
};
|
|
305
334
|
}
|
|
306
335
|
return {
|
|
307
|
-
initialValue: expression.name ? expression.name :
|
|
308
|
-
ariaLabel: ( localize(
|
|
309
|
-
placeholder: ( localize(
|
|
336
|
+
initialValue: expression.name ? expression.name : "",
|
|
337
|
+
ariaLabel: ( localize(7334, "Type watch expression")),
|
|
338
|
+
placeholder: ( localize(7335, "Expression to watch")),
|
|
310
339
|
onFinish: (value, success) => {
|
|
311
340
|
if (success && value) {
|
|
312
341
|
this.debugService.renameWatchExpression(expression.getId(), value);
|
|
313
342
|
ignoreViewUpdates = true;
|
|
314
343
|
this.debugService.getViewModel().updateViews();
|
|
315
344
|
ignoreViewUpdates = false;
|
|
316
|
-
}
|
|
317
|
-
else if (!expression.name) {
|
|
345
|
+
} else if (!expression.name) {
|
|
318
346
|
this.debugService.removeWatchExpressions(expression.getId());
|
|
319
347
|
}
|
|
320
348
|
}
|
|
@@ -323,28 +351,38 @@ let WatchExpressionsRenderer = class WatchExpressionsRenderer extends AbstractEx
|
|
|
323
351
|
renderActionBar(actionBar, expression) {
|
|
324
352
|
const contextKeyService = getContextForWatchExpressionMenu(this.contextKeyService, expression);
|
|
325
353
|
const context = expression;
|
|
326
|
-
const menu = this.menuService.getMenuActions(MenuId.DebugWatchContext, contextKeyService, {
|
|
327
|
-
|
|
354
|
+
const menu = this.menuService.getMenuActions(MenuId.DebugWatchContext, contextKeyService, {
|
|
355
|
+
arg: context,
|
|
356
|
+
shouldForwardArgs: false
|
|
357
|
+
});
|
|
358
|
+
const {
|
|
359
|
+
primary
|
|
360
|
+
} = getContextMenuActions(menu, "inline");
|
|
328
361
|
actionBar.clear();
|
|
329
362
|
actionBar.context = context;
|
|
330
|
-
actionBar.push(primary, {
|
|
363
|
+
actionBar.push(primary, {
|
|
364
|
+
icon: true,
|
|
365
|
+
label: false
|
|
366
|
+
});
|
|
331
367
|
}
|
|
332
368
|
};
|
|
333
|
-
WatchExpressionsRenderer = WatchExpressionsRenderer_1 = ( __decorate([
|
|
334
|
-
( __param(1, IMenuService)),
|
|
335
|
-
( __param(2, IContextKeyService)),
|
|
336
|
-
( __param(3, IDebugService)),
|
|
337
|
-
( __param(4, IContextViewService)),
|
|
338
|
-
( __param(5, IHoverService)),
|
|
339
|
-
( __param(6, IConfigurationService))
|
|
340
|
-
], WatchExpressionsRenderer));
|
|
369
|
+
WatchExpressionsRenderer = WatchExpressionsRenderer_1 = ( __decorate([( __param(1, IMenuService)), ( __param(2, IContextKeyService)), ( __param(3, IDebugService)), ( __param(4, IContextViewService)), ( __param(5, IHoverService)), ( __param(6, IConfigurationService))], WatchExpressionsRenderer));
|
|
341
370
|
function getContextForWatchExpressionMenu(parentContext, expression, additionalContext = []) {
|
|
342
371
|
const session = expression.getSession();
|
|
343
372
|
return parentContext.createOverlay([
|
|
344
|
-
[CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT.key,
|
|
345
|
-
[
|
|
346
|
-
|
|
347
|
-
|
|
373
|
+
[CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT.key, "evaluateName" in expression],
|
|
374
|
+
[
|
|
375
|
+
CONTEXT_WATCH_ITEM_TYPE.key,
|
|
376
|
+
expression instanceof Expression ? "expression" : expression instanceof Variable ? "variable" : undefined
|
|
377
|
+
],
|
|
378
|
+
[
|
|
379
|
+
CONTEXT_CAN_VIEW_MEMORY.key,
|
|
380
|
+
!!session?.capabilities.supportsReadMemoryRequest && expression.memoryReference !== undefined
|
|
381
|
+
],
|
|
382
|
+
[
|
|
383
|
+
CONTEXT_VARIABLE_IS_READONLY.key,
|
|
384
|
+
!!expression.presentationHint?.attributes?.includes("readOnly") || expression.presentationHint?.lazy
|
|
385
|
+
],
|
|
348
386
|
[CONTEXT_VARIABLE_TYPE.key, expression.type],
|
|
349
387
|
[CONTEXT_DEBUG_TYPE.key, session?.configuration.type],
|
|
350
388
|
...additionalContext
|
|
@@ -359,37 +397,33 @@ async function getContextForWatchExpressionMenuWithDataAccess(parentContext, exp
|
|
|
359
397
|
const stackFrame = debugService.getViewModel().focusedStackFrame;
|
|
360
398
|
let dataBreakpointInfoResponse;
|
|
361
399
|
try {
|
|
362
|
-
if (
|
|
400
|
+
if ("evaluateName" in expression && expression.evaluateName) {
|
|
363
401
|
dataBreakpointInfoResponse = await session.dataBreakpointInfo(expression.evaluateName, undefined, stackFrame?.frameId);
|
|
364
|
-
}
|
|
365
|
-
else if (expression instanceof Variable) {
|
|
402
|
+
} else if (expression instanceof Variable) {
|
|
366
403
|
dataBreakpointInfoResponse = await session.dataBreakpointInfo(expression.name, expression.parent.reference, stackFrame?.frameId);
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
404
|
+
} else {
|
|
369
405
|
dataBreakpointInfoResponse = await session.dataBreakpointInfo(expression.name, undefined, stackFrame?.frameId);
|
|
370
406
|
}
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
logService.error('Failed to get data breakpoint info for watch expression:', error);
|
|
407
|
+
} catch (error) {
|
|
408
|
+
logService.error("Failed to get data breakpoint info for watch expression:", error);
|
|
374
409
|
}
|
|
375
410
|
const dataBreakpointId = dataBreakpointInfoResponse?.dataId;
|
|
376
411
|
const dataBreakpointAccessTypes = dataBreakpointInfoResponse?.accessTypes;
|
|
377
412
|
setDataBreakpointInfoResponse(dataBreakpointInfoResponse);
|
|
378
413
|
if (!dataBreakpointAccessTypes) {
|
|
379
414
|
contextKeys.push([CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED.key, !!dataBreakpointId]);
|
|
380
|
-
}
|
|
381
|
-
else {
|
|
415
|
+
} else {
|
|
382
416
|
for (const accessType of dataBreakpointAccessTypes) {
|
|
383
417
|
switch (accessType) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
418
|
+
case "read":
|
|
419
|
+
contextKeys.push([CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED.key, !!dataBreakpointId]);
|
|
420
|
+
break;
|
|
421
|
+
case "write":
|
|
422
|
+
contextKeys.push([CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED.key, !!dataBreakpointId]);
|
|
423
|
+
break;
|
|
424
|
+
case "readWrite":
|
|
425
|
+
contextKeys.push([CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED.key, !!dataBreakpointId]);
|
|
426
|
+
break;
|
|
393
427
|
}
|
|
394
428
|
}
|
|
395
429
|
}
|
|
@@ -397,13 +431,13 @@ async function getContextForWatchExpressionMenuWithDataAccess(parentContext, exp
|
|
|
397
431
|
}
|
|
398
432
|
class WatchExpressionsAccessibilityProvider {
|
|
399
433
|
getWidgetAriaLabel() {
|
|
400
|
-
return localize(
|
|
434
|
+
return localize(7336, "Debug Watch Expressions");
|
|
401
435
|
}
|
|
402
436
|
getAriaLabel(element) {
|
|
403
437
|
if (element instanceof Expression) {
|
|
404
|
-
return localize(
|
|
438
|
+
return localize(7337, "{0}, value {1}", element.name, element.value);
|
|
405
439
|
}
|
|
406
|
-
return localize(
|
|
440
|
+
return localize(7338, "{0}, value {1}", element.name, element.value);
|
|
407
441
|
}
|
|
408
442
|
}
|
|
409
443
|
class WatchExpressionsDragAndDrop {
|
|
@@ -412,7 +446,7 @@ class WatchExpressionsDragAndDrop {
|
|
|
412
446
|
}
|
|
413
447
|
onDragStart(data, originalEvent) {
|
|
414
448
|
if (data instanceof ElementsDragAndDropData) {
|
|
415
|
-
originalEvent.dataTransfer.setData(
|
|
449
|
+
originalEvent.dataTransfer.setData("text/plain", data.elements[0].name);
|
|
416
450
|
}
|
|
417
451
|
}
|
|
418
452
|
onDragOver(data, targetElement, targetIndex, targetSector, originalEvent) {
|
|
@@ -427,20 +461,26 @@ class WatchExpressionsDragAndDrop {
|
|
|
427
461
|
if (targetIndex === undefined) {
|
|
428
462
|
dropEffectPosition = ListDragOverEffectPosition.After;
|
|
429
463
|
targetIndex = -1;
|
|
430
|
-
}
|
|
431
|
-
else {
|
|
464
|
+
} else {
|
|
432
465
|
switch (targetSector) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
466
|
+
case ListViewTargetSector.TOP:
|
|
467
|
+
case ListViewTargetSector.CENTER_TOP:
|
|
468
|
+
dropEffectPosition = ListDragOverEffectPosition.Before;
|
|
469
|
+
break;
|
|
470
|
+
case ListViewTargetSector.CENTER_BOTTOM:
|
|
471
|
+
case ListViewTargetSector.BOTTOM:
|
|
472
|
+
dropEffectPosition = ListDragOverEffectPosition.After;
|
|
473
|
+
break;
|
|
441
474
|
}
|
|
442
475
|
}
|
|
443
|
-
return {
|
|
476
|
+
return {
|
|
477
|
+
accept: true,
|
|
478
|
+
effect: {
|
|
479
|
+
type: ListDragOverEffectType.Move,
|
|
480
|
+
position: dropEffectPosition
|
|
481
|
+
},
|
|
482
|
+
feedback: [targetIndex]
|
|
483
|
+
};
|
|
444
484
|
}
|
|
445
485
|
getDragURI(element) {
|
|
446
486
|
if (!(element instanceof Expression) || element === this.debugService.getViewModel().getSelectedExpression()?.expression) {
|
|
@@ -460,7 +500,7 @@ class WatchExpressionsDragAndDrop {
|
|
|
460
500
|
}
|
|
461
501
|
const draggedElement = data.elements[0];
|
|
462
502
|
if (!(draggedElement instanceof Expression)) {
|
|
463
|
-
throw ( new Error(
|
|
503
|
+
throw ( new Error("Invalid dragged element"));
|
|
464
504
|
}
|
|
465
505
|
const watches = this.debugService.getModel().getWatchExpressions();
|
|
466
506
|
const sourcePosition = watches.indexOf(draggedElement);
|
|
@@ -468,36 +508,35 @@ class WatchExpressionsDragAndDrop {
|
|
|
468
508
|
if (targetElement instanceof Expression) {
|
|
469
509
|
targetPosition = watches.indexOf(targetElement);
|
|
470
510
|
switch (targetSector) {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
511
|
+
case ListViewTargetSector.BOTTOM:
|
|
512
|
+
case ListViewTargetSector.CENTER_BOTTOM:
|
|
513
|
+
targetPosition++;
|
|
514
|
+
break;
|
|
475
515
|
}
|
|
476
516
|
if (sourcePosition < targetPosition) {
|
|
477
517
|
targetPosition--;
|
|
478
518
|
}
|
|
479
|
-
}
|
|
480
|
-
else {
|
|
519
|
+
} else {
|
|
481
520
|
targetPosition = watches.length - 1;
|
|
482
521
|
}
|
|
483
522
|
this.debugService.moveWatchExpression(draggedElement.getId(), targetPosition);
|
|
484
523
|
}
|
|
485
|
-
dispose() {
|
|
524
|
+
dispose() {}
|
|
486
525
|
}
|
|
487
526
|
registerAction2(class Collapse extends ViewAction {
|
|
488
527
|
constructor() {
|
|
489
528
|
super({
|
|
490
|
-
id:
|
|
529
|
+
id: "watch.collapse",
|
|
491
530
|
viewId: WATCH_VIEW_ID,
|
|
492
|
-
title: ( localize(
|
|
531
|
+
title: ( localize(7339, "Collapse All")),
|
|
493
532
|
f1: false,
|
|
494
533
|
icon: Codicon.collapseAll,
|
|
495
534
|
precondition: CONTEXT_WATCH_EXPRESSIONS_EXIST,
|
|
496
535
|
menu: {
|
|
497
536
|
id: MenuId.ViewTitle,
|
|
498
537
|
order: 30,
|
|
499
|
-
group:
|
|
500
|
-
when: ( ContextKeyExpr.equals(
|
|
538
|
+
group: "navigation",
|
|
539
|
+
when: ( ContextKeyExpr.equals("view", WATCH_VIEW_ID))
|
|
501
540
|
}
|
|
502
541
|
});
|
|
503
542
|
}
|
|
@@ -505,8 +544,8 @@ registerAction2(class Collapse extends ViewAction {
|
|
|
505
544
|
view.collapseAll();
|
|
506
545
|
}
|
|
507
546
|
});
|
|
508
|
-
const ADD_WATCH_ID =
|
|
509
|
-
const ADD_WATCH_LABEL = ( localize(
|
|
547
|
+
const ADD_WATCH_ID = "workbench.debug.viewlet.action.addWatchExpression";
|
|
548
|
+
const ADD_WATCH_LABEL = ( localize(7340, "Add Expression"));
|
|
510
549
|
registerAction2(class AddWatchExpressionAction extends Action2 {
|
|
511
550
|
constructor() {
|
|
512
551
|
super({
|
|
@@ -516,8 +555,8 @@ registerAction2(class AddWatchExpressionAction extends Action2 {
|
|
|
516
555
|
icon: watchExpressionsAdd,
|
|
517
556
|
menu: {
|
|
518
557
|
id: MenuId.ViewTitle,
|
|
519
|
-
group:
|
|
520
|
-
when: ( ContextKeyExpr.equals(
|
|
558
|
+
group: "navigation",
|
|
559
|
+
when: ( ContextKeyExpr.equals("view", WATCH_VIEW_ID))
|
|
521
560
|
}
|
|
522
561
|
});
|
|
523
562
|
}
|
|
@@ -526,8 +565,8 @@ registerAction2(class AddWatchExpressionAction extends Action2 {
|
|
|
526
565
|
debugService.addWatchExpression();
|
|
527
566
|
}
|
|
528
567
|
});
|
|
529
|
-
const REMOVE_WATCH_EXPRESSIONS_COMMAND_ID =
|
|
530
|
-
const REMOVE_WATCH_EXPRESSIONS_LABEL = ( localize(
|
|
568
|
+
const REMOVE_WATCH_EXPRESSIONS_COMMAND_ID = "workbench.debug.viewlet.action.removeAllWatchExpressions";
|
|
569
|
+
const REMOVE_WATCH_EXPRESSIONS_LABEL = ( localize(7341, "Remove All Expressions"));
|
|
531
570
|
registerAction2(class RemoveAllWatchExpressionsAction extends Action2 {
|
|
532
571
|
constructor() {
|
|
533
572
|
super({
|
|
@@ -539,8 +578,8 @@ registerAction2(class RemoveAllWatchExpressionsAction extends Action2 {
|
|
|
539
578
|
menu: {
|
|
540
579
|
id: MenuId.ViewTitle,
|
|
541
580
|
order: 20,
|
|
542
|
-
group:
|
|
543
|
-
when: ( ContextKeyExpr.equals(
|
|
581
|
+
group: "navigation",
|
|
582
|
+
when: ( ContextKeyExpr.equals("view", WATCH_VIEW_ID))
|
|
544
583
|
}
|
|
545
584
|
});
|
|
546
585
|
}
|
|
@@ -553,20 +592,20 @@ registerAction2(class CopyExpression extends ViewAction {
|
|
|
553
592
|
constructor() {
|
|
554
593
|
super({
|
|
555
594
|
id: COPY_WATCH_EXPRESSION_COMMAND_ID,
|
|
556
|
-
title: ( localize(
|
|
595
|
+
title: ( localize(7342, "Copy Expression")),
|
|
557
596
|
f1: false,
|
|
558
597
|
viewId: WATCH_VIEW_ID,
|
|
559
598
|
precondition: CONTEXT_WATCH_EXPRESSIONS_EXIST,
|
|
560
599
|
keybinding: {
|
|
561
600
|
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyC,
|
|
562
601
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
563
|
-
when: ( ContextKeyExpr.and(( FocusedViewContext.isEqualTo(WATCH_VIEW_ID)), ( CONTEXT_EXPRESSION_SELECTED.negate())))
|
|
602
|
+
when: ( ContextKeyExpr.and(( FocusedViewContext.isEqualTo(WATCH_VIEW_ID)), ( CONTEXT_EXPRESSION_SELECTED.negate())))
|
|
564
603
|
},
|
|
565
604
|
menu: {
|
|
566
605
|
id: MenuId.DebugWatchContext,
|
|
567
606
|
order: 20,
|
|
568
|
-
group:
|
|
569
|
-
when: ( CONTEXT_WATCH_ITEM_TYPE.isEqualTo(
|
|
607
|
+
group: "3_modification",
|
|
608
|
+
when: ( CONTEXT_WATCH_ITEM_TYPE.isEqualTo("expression"))
|
|
570
609
|
}
|
|
571
610
|
});
|
|
572
611
|
}
|