@codingame/monaco-vscode-debug-service-override 4.1.0 → 4.1.2
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/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/override/vs/platform/dialogs/common/dialogs.js +10 -0
- package/package.json +2 -2
- package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +73 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +1026 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +1004 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +347 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +337 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +432 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +1039 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +649 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +64 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +636 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +740 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +408 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +206 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +80 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +169 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +1271 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +1330 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +115 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +77 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +307 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +31 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +387 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +267 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +817 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +131 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +142 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +262 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +669 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +709 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +1002 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +48 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +352 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +129 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +734 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +501 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +162 -0
- package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +21 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +17 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +110 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +62 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +460 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +166 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +36 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +150 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +289 -0
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +87 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +64 -0
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +311 -0
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +29 -0
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { append, $ as $$1 } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
+
import { HighlightedLabel } from 'vscode/vscode/vs/base/browser/ui/highlightedlabel/highlightedLabel';
|
|
4
|
+
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
5
|
+
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
6
|
+
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
7
|
+
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
8
|
+
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
9
|
+
import { createMatches } from 'vscode/vscode/vs/base/common/filters';
|
|
10
|
+
import { toDisposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
|
+
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
12
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
13
|
+
import { createAndFillInContextMenuActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
14
|
+
import { MenuId, registerAction2, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
15
|
+
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
16
|
+
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
17
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
18
|
+
import { ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
19
|
+
import { IContextMenuService, IContextViewService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
20
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
21
|
+
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
22
|
+
import { WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
23
|
+
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
24
|
+
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
25
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
26
|
+
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
27
|
+
import { ViewAction, ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
28
|
+
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
29
|
+
import { AbstractExpressionsRenderer, renderExpressionValue, renderVariable, renderViewTree, AbstractExpressionDataSource } from 'vscode/vscode/vs/workbench/contrib/debug/browser/baseDebugView';
|
|
30
|
+
import { LinkDetector } from './linkDetector.js';
|
|
31
|
+
import { IDebugService, VARIABLES_VIEW_ID, CONTEXT_VARIABLES_FOCUSED, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
32
|
+
import { getContextForVariable } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugContext';
|
|
33
|
+
import { VisualizedExpression, Variable, getUriForDebugMemory, Expression, ErrorScope, Scope, StackFrame } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
|
|
34
|
+
import { IDebugVisualizerService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugVisualizers';
|
|
35
|
+
import { IExtensionsWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
36
|
+
import { IEditorService, SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
37
|
+
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
38
|
+
|
|
39
|
+
var VisualizedVariableRenderer_1, VariablesRenderer_1;
|
|
40
|
+
const $ = $$1;
|
|
41
|
+
let forgetScopes = true;
|
|
42
|
+
let variableInternalContext;
|
|
43
|
+
let dataBreakpointInfoResponse;
|
|
44
|
+
let VariablesView = class VariablesView extends ViewPane {
|
|
45
|
+
constructor(options, contextMenuService, debugService, keybindingService, configurationService, instantiationService, viewDescriptorService, contextKeyService, openerService, themeService, telemetryService, menuService) {
|
|
46
|
+
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
47
|
+
this.debugService = debugService;
|
|
48
|
+
this.menuService = menuService;
|
|
49
|
+
this.needsRefresh = false;
|
|
50
|
+
this.savedViewState = ( new Map());
|
|
51
|
+
this.autoExpandedScopes = ( new Set());
|
|
52
|
+
this.updateTreeScheduler = ( new RunOnceScheduler(async () => {
|
|
53
|
+
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
|
|
54
|
+
this.needsRefresh = false;
|
|
55
|
+
const input = this.tree.getInput();
|
|
56
|
+
if (input) {
|
|
57
|
+
this.savedViewState.set(input.getId(), this.tree.getViewState());
|
|
58
|
+
}
|
|
59
|
+
if (!stackFrame) {
|
|
60
|
+
await this.tree.setInput(null);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const viewState = this.savedViewState.get(stackFrame.getId());
|
|
64
|
+
await this.tree.setInput(stackFrame, viewState);
|
|
65
|
+
const scopes = await stackFrame.getScopes();
|
|
66
|
+
const toExpand = scopes.find(s => !s.expensive);
|
|
67
|
+
if (toExpand && this.tree.hasNode(toExpand)) {
|
|
68
|
+
this.autoExpandedScopes.add(toExpand.getId());
|
|
69
|
+
await this.tree.expand(toExpand);
|
|
70
|
+
}
|
|
71
|
+
}, 400));
|
|
72
|
+
}
|
|
73
|
+
renderBody(container) {
|
|
74
|
+
super.renderBody(container);
|
|
75
|
+
this.element.classList.add('debug-pane');
|
|
76
|
+
container.classList.add('debug-variables');
|
|
77
|
+
const treeContainer = renderViewTree(container);
|
|
78
|
+
const linkDetector = this.instantiationService.createInstance(LinkDetector);
|
|
79
|
+
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'VariablesView', treeContainer, ( new VariablesDelegate()), [
|
|
80
|
+
this.instantiationService.createInstance(VariablesRenderer, linkDetector),
|
|
81
|
+
this.instantiationService.createInstance(VisualizedVariableRenderer, linkDetector),
|
|
82
|
+
( new ScopesRenderer()),
|
|
83
|
+
( new ScopeErrorRenderer()),
|
|
84
|
+
], this.instantiationService.createInstance(VariablesDataSource), {
|
|
85
|
+
accessibilityProvider: ( new VariablesAccessibilityProvider()),
|
|
86
|
+
identityProvider: { getId: (element) => element.getId() },
|
|
87
|
+
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e) => e.name },
|
|
88
|
+
overrideStyles: {
|
|
89
|
+
listBackground: this.getBackgroundColor()
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
this._register(VisualizedVariableRenderer.rendererOnVisualizationRange(this.debugService.getViewModel(), this.tree));
|
|
93
|
+
this.tree.setInput(this.debugService.getViewModel().focusedStackFrame ?? null);
|
|
94
|
+
CONTEXT_VARIABLES_FOCUSED.bindTo(this.tree.contextKeyService);
|
|
95
|
+
this._register(this.debugService.getViewModel().onDidFocusStackFrame(sf => {
|
|
96
|
+
if (!this.isBodyVisible()) {
|
|
97
|
+
this.needsRefresh = true;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const timeout = sf.explicit ? 0 : undefined;
|
|
101
|
+
this.updateTreeScheduler.schedule(timeout);
|
|
102
|
+
}));
|
|
103
|
+
this._register(this.debugService.getViewModel().onWillUpdateViews(() => {
|
|
104
|
+
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
|
|
105
|
+
if (stackFrame && forgetScopes) {
|
|
106
|
+
stackFrame.forgetScopes();
|
|
107
|
+
}
|
|
108
|
+
forgetScopes = true;
|
|
109
|
+
this.tree.updateChildren();
|
|
110
|
+
}));
|
|
111
|
+
this._register(this.tree);
|
|
112
|
+
this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
|
|
113
|
+
this._register(this.tree.onContextMenu(async (e) => await this.onContextMenu(e)));
|
|
114
|
+
this._register(this.onDidChangeBodyVisibility(visible => {
|
|
115
|
+
if (visible && this.needsRefresh) {
|
|
116
|
+
this.updateTreeScheduler.schedule();
|
|
117
|
+
}
|
|
118
|
+
}));
|
|
119
|
+
let horizontalScrolling;
|
|
120
|
+
this._register(this.debugService.getViewModel().onDidSelectExpression(e => {
|
|
121
|
+
const variable = e?.expression;
|
|
122
|
+
if (variable && this.tree.hasNode(variable)) {
|
|
123
|
+
horizontalScrolling = this.tree.options.horizontalScrolling;
|
|
124
|
+
if (horizontalScrolling) {
|
|
125
|
+
this.tree.updateOptions({ horizontalScrolling: false });
|
|
126
|
+
}
|
|
127
|
+
this.tree.rerender(variable);
|
|
128
|
+
}
|
|
129
|
+
else if (!e && horizontalScrolling !== undefined) {
|
|
130
|
+
this.tree.updateOptions({ horizontalScrolling: horizontalScrolling });
|
|
131
|
+
horizontalScrolling = undefined;
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
this._register(this.debugService.getViewModel().onDidEvaluateLazyExpression(async (e) => {
|
|
135
|
+
if (e instanceof Variable && this.tree.hasNode(e)) {
|
|
136
|
+
await this.tree.updateChildren(e, false, true);
|
|
137
|
+
await this.tree.expand(e);
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
this._register(this.debugService.onDidEndSession(() => {
|
|
141
|
+
this.savedViewState.clear();
|
|
142
|
+
this.autoExpandedScopes.clear();
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
layoutBody(width, height) {
|
|
146
|
+
super.layoutBody(height, width);
|
|
147
|
+
this.tree.layout(width, height);
|
|
148
|
+
}
|
|
149
|
+
focus() {
|
|
150
|
+
super.focus();
|
|
151
|
+
this.tree.domFocus();
|
|
152
|
+
}
|
|
153
|
+
collapseAll() {
|
|
154
|
+
this.tree.collapseAll();
|
|
155
|
+
}
|
|
156
|
+
onMouseDblClick(e) {
|
|
157
|
+
if (this.canSetExpressionValue(e.element)) {
|
|
158
|
+
this.debugService.getViewModel().setSelectedExpression(e.element, false);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
canSetExpressionValue(e) {
|
|
162
|
+
const session = this.debugService.getViewModel().focusedSession;
|
|
163
|
+
if (!session) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
if (e instanceof VisualizedExpression) {
|
|
167
|
+
return !!e.treeItem.canEdit;
|
|
168
|
+
}
|
|
169
|
+
return e instanceof Variable && !e.presentationHint?.attributes?.includes('readOnly') && !e.presentationHint?.lazy;
|
|
170
|
+
}
|
|
171
|
+
async onContextMenu(e) {
|
|
172
|
+
const variable = e.element;
|
|
173
|
+
if (!(variable instanceof Variable) || !variable.value) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
return openContextMenuForVariableTreeElement(this.contextKeyService, this.menuService, this.contextMenuService, MenuId.DebugVariablesContext, e);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
VariablesView = ( __decorate([
|
|
180
|
+
( __param(1, IContextMenuService)),
|
|
181
|
+
( __param(2, IDebugService)),
|
|
182
|
+
( __param(3, IKeybindingService)),
|
|
183
|
+
( __param(4, IConfigurationService)),
|
|
184
|
+
( __param(5, IInstantiationService)),
|
|
185
|
+
( __param(6, IViewDescriptorService)),
|
|
186
|
+
( __param(7, IContextKeyService)),
|
|
187
|
+
( __param(8, IOpenerService)),
|
|
188
|
+
( __param(9, IThemeService)),
|
|
189
|
+
( __param(10, ITelemetryService)),
|
|
190
|
+
( __param(11, IMenuService))
|
|
191
|
+
], VariablesView));
|
|
192
|
+
async function openContextMenuForVariableTreeElement(parentContextKeyService, menuService, contextMenuService, menuId, e) {
|
|
193
|
+
const variable = e.element;
|
|
194
|
+
if (!(variable instanceof Variable) || !variable.value) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const toDispose = ( new DisposableStore());
|
|
198
|
+
try {
|
|
199
|
+
const contextKeyService = await getContextForVariableMenuWithDataAccess(parentContextKeyService, variable);
|
|
200
|
+
const menu = toDispose.add(menuService.createMenu(menuId, contextKeyService));
|
|
201
|
+
const context = getVariablesContext(variable);
|
|
202
|
+
const secondary = [];
|
|
203
|
+
createAndFillInContextMenuActions(menu, { arg: context, shouldForwardArgs: false }, { primary: [], secondary }, 'inline');
|
|
204
|
+
contextMenuService.showContextMenu({
|
|
205
|
+
getAnchor: () => e.anchor,
|
|
206
|
+
getActions: () => secondary
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
toDispose.dispose();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
const getVariablesContext = (variable) => ({
|
|
214
|
+
sessionId: variable.getSession()?.getId(),
|
|
215
|
+
container: variable.parent instanceof Expression
|
|
216
|
+
? { expression: variable.parent.name }
|
|
217
|
+
: variable.parent.toDebugProtocolObject(),
|
|
218
|
+
variable: variable.toDebugProtocolObject()
|
|
219
|
+
});
|
|
220
|
+
async function getContextForVariableMenuWithDataAccess(parentContext, variable) {
|
|
221
|
+
const session = variable.getSession();
|
|
222
|
+
if (!session || !session.capabilities.supportsDataBreakpoints) {
|
|
223
|
+
return getContextForVariableMenuBase(parentContext, variable);
|
|
224
|
+
}
|
|
225
|
+
const contextKeys = [];
|
|
226
|
+
dataBreakpointInfoResponse = await session.dataBreakpointInfo(variable.name, variable.parent.reference);
|
|
227
|
+
const dataBreakpointId = dataBreakpointInfoResponse?.dataId;
|
|
228
|
+
const dataBreakpointAccessTypes = dataBreakpointInfoResponse?.accessTypes;
|
|
229
|
+
if (!dataBreakpointAccessTypes) {
|
|
230
|
+
contextKeys.push([CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED.key, !!dataBreakpointId]);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
for (const accessType of dataBreakpointAccessTypes) {
|
|
234
|
+
switch (accessType) {
|
|
235
|
+
case 'read':
|
|
236
|
+
contextKeys.push([CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED.key, !!dataBreakpointId]);
|
|
237
|
+
break;
|
|
238
|
+
case 'write':
|
|
239
|
+
contextKeys.push([CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED.key, !!dataBreakpointId]);
|
|
240
|
+
break;
|
|
241
|
+
case 'readWrite':
|
|
242
|
+
contextKeys.push([CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED.key, !!dataBreakpointId]);
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return getContextForVariableMenuBase(parentContext, variable, contextKeys);
|
|
248
|
+
}
|
|
249
|
+
function getContextForVariableMenuBase(parentContext, variable, additionalContext = []) {
|
|
250
|
+
variableInternalContext = variable;
|
|
251
|
+
return getContextForVariable(parentContext, variable, additionalContext);
|
|
252
|
+
}
|
|
253
|
+
function isStackFrame(obj) {
|
|
254
|
+
return obj instanceof StackFrame;
|
|
255
|
+
}
|
|
256
|
+
class VariablesDataSource extends AbstractExpressionDataSource {
|
|
257
|
+
hasChildren(element) {
|
|
258
|
+
if (!element) {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
if (isStackFrame(element)) {
|
|
262
|
+
return true;
|
|
263
|
+
}
|
|
264
|
+
return element.hasChildren;
|
|
265
|
+
}
|
|
266
|
+
doGetChildren(element) {
|
|
267
|
+
if (isStackFrame(element)) {
|
|
268
|
+
return element.getScopes();
|
|
269
|
+
}
|
|
270
|
+
return element.getChildren();
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
class VariablesDelegate {
|
|
274
|
+
getHeight(element) {
|
|
275
|
+
return 22;
|
|
276
|
+
}
|
|
277
|
+
getTemplateId(element) {
|
|
278
|
+
if (element instanceof ErrorScope) {
|
|
279
|
+
return ScopeErrorRenderer.ID;
|
|
280
|
+
}
|
|
281
|
+
if (element instanceof Scope) {
|
|
282
|
+
return ScopesRenderer.ID;
|
|
283
|
+
}
|
|
284
|
+
if (element instanceof VisualizedExpression) {
|
|
285
|
+
return VisualizedVariableRenderer.ID;
|
|
286
|
+
}
|
|
287
|
+
return VariablesRenderer.ID;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
class ScopesRenderer {
|
|
291
|
+
static { this.ID = 'scope'; }
|
|
292
|
+
get templateId() {
|
|
293
|
+
return ScopesRenderer.ID;
|
|
294
|
+
}
|
|
295
|
+
renderTemplate(container) {
|
|
296
|
+
const name = append(container, $('.scope'));
|
|
297
|
+
const label = ( new HighlightedLabel(name));
|
|
298
|
+
return { name, label };
|
|
299
|
+
}
|
|
300
|
+
renderElement(element, index, templateData) {
|
|
301
|
+
templateData.label.set(element.element.name, createMatches(element.filterData));
|
|
302
|
+
}
|
|
303
|
+
disposeTemplate(templateData) {
|
|
304
|
+
templateData.label.dispose();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
class ScopeErrorRenderer {
|
|
308
|
+
static { this.ID = 'scopeError'; }
|
|
309
|
+
get templateId() {
|
|
310
|
+
return ScopeErrorRenderer.ID;
|
|
311
|
+
}
|
|
312
|
+
renderTemplate(container) {
|
|
313
|
+
const wrapper = append(container, $('.scope'));
|
|
314
|
+
const error = append(wrapper, $('.error'));
|
|
315
|
+
return { error };
|
|
316
|
+
}
|
|
317
|
+
renderElement(element, index, templateData) {
|
|
318
|
+
templateData.error.innerText = element.element.name;
|
|
319
|
+
}
|
|
320
|
+
disposeTemplate() {
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
let VisualizedVariableRenderer = class VisualizedVariableRenderer extends AbstractExpressionsRenderer {
|
|
324
|
+
static { VisualizedVariableRenderer_1 = this; }
|
|
325
|
+
static { this.ID = 'viz'; }
|
|
326
|
+
static rendererOnVisualizationRange(model, tree) {
|
|
327
|
+
return model.onDidChangeVisualization(({ original }) => {
|
|
328
|
+
if (!tree.hasNode(original)) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const parent = tree.getParentElement(original);
|
|
332
|
+
tree.updateChildren(parent, false, false);
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
constructor(linkDetector, debugService, contextViewService, menuService, contextKeyService) {
|
|
336
|
+
super(debugService, contextViewService);
|
|
337
|
+
this.linkDetector = linkDetector;
|
|
338
|
+
this.menuService = menuService;
|
|
339
|
+
this.contextKeyService = contextKeyService;
|
|
340
|
+
}
|
|
341
|
+
get templateId() {
|
|
342
|
+
return VisualizedVariableRenderer_1.ID;
|
|
343
|
+
}
|
|
344
|
+
renderElement(node, index, data) {
|
|
345
|
+
super.renderExpressionElement(node.element, node, data);
|
|
346
|
+
}
|
|
347
|
+
renderExpression(expression, data, highlights) {
|
|
348
|
+
const viz = expression;
|
|
349
|
+
let text = viz.name;
|
|
350
|
+
if (viz.value && typeof viz.name === 'string') {
|
|
351
|
+
text += ':';
|
|
352
|
+
}
|
|
353
|
+
data.label.set(text, highlights, viz.name);
|
|
354
|
+
renderExpressionValue(viz, data.value, {
|
|
355
|
+
showChanged: false,
|
|
356
|
+
maxValueLength: 1024,
|
|
357
|
+
showHover: true,
|
|
358
|
+
colorize: true,
|
|
359
|
+
linkDetector: this.linkDetector
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
getInputBoxOptions(expression) {
|
|
363
|
+
const viz = expression;
|
|
364
|
+
return {
|
|
365
|
+
initialValue: expression.value,
|
|
366
|
+
ariaLabel: ( localizeWithPath(
|
|
367
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
368
|
+
'variableValueAriaLabel',
|
|
369
|
+
"Type new variable value"
|
|
370
|
+
)),
|
|
371
|
+
validationOptions: {
|
|
372
|
+
validation: () => viz.errorMessage ? ({ content: viz.errorMessage }) : null
|
|
373
|
+
},
|
|
374
|
+
onFinish: (value, success) => {
|
|
375
|
+
viz.errorMessage = undefined;
|
|
376
|
+
if (success) {
|
|
377
|
+
viz.edit(value).then(() => {
|
|
378
|
+
forgetScopes = false;
|
|
379
|
+
this.debugService.getViewModel().updateViews();
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
renderActionBar(actionBar, expression, _data) {
|
|
386
|
+
const viz = expression;
|
|
387
|
+
const contextKeyService = viz.original ? getContextForVariableMenuBase(this.contextKeyService, viz.original) : this.contextKeyService;
|
|
388
|
+
const menu = this.menuService.createMenu(MenuId.DebugVariablesContext, contextKeyService);
|
|
389
|
+
const primary = [];
|
|
390
|
+
const context = viz.original ? getVariablesContext(viz.original) : undefined;
|
|
391
|
+
createAndFillInContextMenuActions(menu, { arg: context, shouldForwardArgs: false }, { primary, secondary: [] }, 'inline');
|
|
392
|
+
if (viz.original) {
|
|
393
|
+
const action = ( new Action('debugViz', ( localizeWithPath(
|
|
394
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
395
|
+
'removeVisualizer',
|
|
396
|
+
'Remove Visualizer'
|
|
397
|
+
)), ThemeIcon.asClassName(Codicon.eye), true, () => this.debugService.getViewModel().setVisualizedExpression(viz.original, undefined)));
|
|
398
|
+
action.checked = true;
|
|
399
|
+
primary.push(action);
|
|
400
|
+
actionBar.domNode.style.display = 'initial';
|
|
401
|
+
}
|
|
402
|
+
actionBar.clear();
|
|
403
|
+
actionBar.context = context;
|
|
404
|
+
actionBar.push(primary, { icon: true, label: false });
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
VisualizedVariableRenderer = VisualizedVariableRenderer_1 = ( __decorate([
|
|
408
|
+
( __param(1, IDebugService)),
|
|
409
|
+
( __param(2, IContextViewService)),
|
|
410
|
+
( __param(3, IMenuService)),
|
|
411
|
+
( __param(4, IContextKeyService))
|
|
412
|
+
], VisualizedVariableRenderer));
|
|
413
|
+
let VariablesRenderer = class VariablesRenderer extends AbstractExpressionsRenderer {
|
|
414
|
+
static { VariablesRenderer_1 = this; }
|
|
415
|
+
static { this.ID = 'variable'; }
|
|
416
|
+
constructor(linkDetector, menuService, contextKeyService, visualization, contextMenuService, debugService, contextViewService) {
|
|
417
|
+
super(debugService, contextViewService);
|
|
418
|
+
this.linkDetector = linkDetector;
|
|
419
|
+
this.menuService = menuService;
|
|
420
|
+
this.contextKeyService = contextKeyService;
|
|
421
|
+
this.visualization = visualization;
|
|
422
|
+
this.contextMenuService = contextMenuService;
|
|
423
|
+
}
|
|
424
|
+
get templateId() {
|
|
425
|
+
return VariablesRenderer_1.ID;
|
|
426
|
+
}
|
|
427
|
+
renderExpression(expression, data, highlights) {
|
|
428
|
+
renderVariable(expression, data, true, highlights, this.linkDetector);
|
|
429
|
+
}
|
|
430
|
+
renderElement(node, index, data) {
|
|
431
|
+
super.renderExpressionElement(node.element, node, data);
|
|
432
|
+
}
|
|
433
|
+
getInputBoxOptions(expression) {
|
|
434
|
+
const variable = expression;
|
|
435
|
+
return {
|
|
436
|
+
initialValue: expression.value,
|
|
437
|
+
ariaLabel: ( localizeWithPath(
|
|
438
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
439
|
+
'variableValueAriaLabel',
|
|
440
|
+
"Type new variable value"
|
|
441
|
+
)),
|
|
442
|
+
validationOptions: {
|
|
443
|
+
validation: () => variable.errorMessage ? ({ content: variable.errorMessage }) : null
|
|
444
|
+
},
|
|
445
|
+
onFinish: (value, success) => {
|
|
446
|
+
variable.errorMessage = undefined;
|
|
447
|
+
const focusedStackFrame = this.debugService.getViewModel().focusedStackFrame;
|
|
448
|
+
if (success && variable.value !== value && focusedStackFrame) {
|
|
449
|
+
variable.setVariable(value, focusedStackFrame)
|
|
450
|
+
.then(() => {
|
|
451
|
+
forgetScopes = false;
|
|
452
|
+
this.debugService.getViewModel().updateViews();
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
renderActionBar(actionBar, expression, data) {
|
|
459
|
+
const variable = expression;
|
|
460
|
+
const contextKeyService = getContextForVariableMenuBase(this.contextKeyService, variable);
|
|
461
|
+
const menu = this.menuService.createMenu(MenuId.DebugVariablesContext, contextKeyService);
|
|
462
|
+
const primary = [];
|
|
463
|
+
const context = getVariablesContext(variable);
|
|
464
|
+
createAndFillInContextMenuActions(menu, { arg: context, shouldForwardArgs: false }, { primary, secondary: [] }, 'inline');
|
|
465
|
+
actionBar.clear();
|
|
466
|
+
actionBar.context = context;
|
|
467
|
+
actionBar.push(primary, { icon: true, label: false });
|
|
468
|
+
const cts = ( new CancellationTokenSource());
|
|
469
|
+
data.elementDisposable.add(toDisposable(() => cts.dispose(true)));
|
|
470
|
+
this.visualization.getApplicableFor(expression, cts.token).then(result => {
|
|
471
|
+
data.elementDisposable.add(result);
|
|
472
|
+
const originalExpression = (expression instanceof VisualizedExpression && expression.original) || expression;
|
|
473
|
+
const actions = ( result.object.map(v => ( new Action(
|
|
474
|
+
'debugViz',
|
|
475
|
+
v.name,
|
|
476
|
+
v.iconClass || 'debug-viz-icon',
|
|
477
|
+
undefined,
|
|
478
|
+
this.useVisualizer(v, originalExpression, cts.token)
|
|
479
|
+
))));
|
|
480
|
+
if (actions.length === 0) ;
|
|
481
|
+
else if (actions.length === 1) {
|
|
482
|
+
actionBar.push(actions[0], { icon: true, label: false });
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
actionBar.push(( new Action('debugViz', ( localizeWithPath(
|
|
486
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
487
|
+
'useVisualizer',
|
|
488
|
+
'Visualize Variable...'
|
|
489
|
+
)), ThemeIcon.asClassName(Codicon.eye), undefined, () => this.pickVisualizer(actions, originalExpression, data))), { icon: true, label: false });
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
pickVisualizer(actions, expression, data) {
|
|
494
|
+
this.contextMenuService.showContextMenu({
|
|
495
|
+
getAnchor: () => data.actionBar.getContainer(),
|
|
496
|
+
getActions: () => actions,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
useVisualizer(viz, expression, token) {
|
|
500
|
+
return async () => {
|
|
501
|
+
const resolved = await viz.resolve(token);
|
|
502
|
+
if (token.isCancellationRequested) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
if (resolved.type === 0 ) {
|
|
506
|
+
viz.execute();
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
509
|
+
const replacement = await this.visualization.getVisualizedNodeFor(resolved.id, expression);
|
|
510
|
+
if (replacement) {
|
|
511
|
+
this.debugService.getViewModel().setVisualizedExpression(expression, replacement);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
VariablesRenderer = VariablesRenderer_1 = ( __decorate([
|
|
518
|
+
( __param(1, IMenuService)),
|
|
519
|
+
( __param(2, IContextKeyService)),
|
|
520
|
+
( __param(3, IDebugVisualizerService)),
|
|
521
|
+
( __param(4, IContextMenuService)),
|
|
522
|
+
( __param(5, IDebugService)),
|
|
523
|
+
( __param(6, IContextViewService))
|
|
524
|
+
], VariablesRenderer));
|
|
525
|
+
class VariablesAccessibilityProvider {
|
|
526
|
+
getWidgetAriaLabel() {
|
|
527
|
+
return ( localizeWithPath(
|
|
528
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
529
|
+
'variablesAriaTreeLabel',
|
|
530
|
+
"Debug Variables"
|
|
531
|
+
));
|
|
532
|
+
}
|
|
533
|
+
getAriaLabel(element) {
|
|
534
|
+
if (element instanceof Scope) {
|
|
535
|
+
return ( localizeWithPath(
|
|
536
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
537
|
+
'variableScopeAriaLabel',
|
|
538
|
+
"Scope {0}",
|
|
539
|
+
element.name
|
|
540
|
+
));
|
|
541
|
+
}
|
|
542
|
+
if (element instanceof Variable) {
|
|
543
|
+
return ( localizeWithPath(
|
|
544
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
545
|
+
{ key: 'variableAriaLabel', comment: ['Placeholders are variable name and variable value respectivly. They should not be translated.'] },
|
|
546
|
+
"{0}, value {1}",
|
|
547
|
+
element.name,
|
|
548
|
+
element.value
|
|
549
|
+
));
|
|
550
|
+
}
|
|
551
|
+
return null;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
const SET_VARIABLE_ID = 'debug.setVariable';
|
|
555
|
+
CommandsRegistry.registerCommand({
|
|
556
|
+
id: SET_VARIABLE_ID,
|
|
557
|
+
handler: (accessor) => {
|
|
558
|
+
const debugService = accessor.get(IDebugService);
|
|
559
|
+
debugService.getViewModel().setSelectedExpression(variableInternalContext, false);
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
const COPY_VALUE_ID = 'workbench.debug.viewlet.action.copyValue';
|
|
563
|
+
CommandsRegistry.registerCommand({
|
|
564
|
+
id: COPY_VALUE_ID,
|
|
565
|
+
handler: async (accessor, arg, ctx) => {
|
|
566
|
+
const debugService = accessor.get(IDebugService);
|
|
567
|
+
const clipboardService = accessor.get(IClipboardService);
|
|
568
|
+
let elementContext = '';
|
|
569
|
+
let elements;
|
|
570
|
+
if (arg instanceof Variable || arg instanceof Expression) {
|
|
571
|
+
elementContext = 'watch';
|
|
572
|
+
elements = ctx ? ctx : [];
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
elementContext = 'variables';
|
|
576
|
+
elements = variableInternalContext ? [variableInternalContext] : [];
|
|
577
|
+
}
|
|
578
|
+
const stackFrame = debugService.getViewModel().focusedStackFrame;
|
|
579
|
+
const session = debugService.getViewModel().focusedSession;
|
|
580
|
+
if (!stackFrame || !session || elements.length === 0) {
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
const evalContext = session.capabilities.supportsClipboardContext ? 'clipboard' : elementContext;
|
|
584
|
+
const toEvaluate = ( elements.map(
|
|
585
|
+
element => element instanceof Variable ? (element.evaluateName || element.value) : element.name
|
|
586
|
+
));
|
|
587
|
+
try {
|
|
588
|
+
const evaluations = await Promise.all(( toEvaluate.map(expr => session.evaluate(expr, stackFrame.frameId, evalContext))));
|
|
589
|
+
const result = ( coalesce(evaluations).map(evaluation => evaluation.body.result));
|
|
590
|
+
if (result.length) {
|
|
591
|
+
clipboardService.writeText(result.join('\n'));
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
catch (e) {
|
|
595
|
+
const result = ( elements.map(element => element.value));
|
|
596
|
+
clipboardService.writeText(result.join('\n'));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
const VIEW_MEMORY_ID = 'workbench.debug.viewlet.action.viewMemory';
|
|
601
|
+
const HEX_EDITOR_EXTENSION_ID = 'ms-vscode.hexeditor';
|
|
602
|
+
const HEX_EDITOR_EDITOR_ID = 'hexEditor.hexedit';
|
|
603
|
+
CommandsRegistry.registerCommand({
|
|
604
|
+
id: VIEW_MEMORY_ID,
|
|
605
|
+
handler: async (accessor, arg, ctx) => {
|
|
606
|
+
const debugService = accessor.get(IDebugService);
|
|
607
|
+
let sessionId;
|
|
608
|
+
let memoryReference;
|
|
609
|
+
if ('sessionId' in arg) {
|
|
610
|
+
if (!arg.sessionId || !arg.variable.memoryReference) {
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
sessionId = arg.sessionId;
|
|
614
|
+
memoryReference = arg.variable.memoryReference;
|
|
615
|
+
}
|
|
616
|
+
else {
|
|
617
|
+
if (!arg.memoryReference) {
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
const focused = debugService.getViewModel().focusedSession;
|
|
621
|
+
if (!focused) {
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
sessionId = focused.getId();
|
|
625
|
+
memoryReference = arg.memoryReference;
|
|
626
|
+
}
|
|
627
|
+
const extensionsWorkbenchService = accessor.get(IExtensionsWorkbenchService);
|
|
628
|
+
const editorService = accessor.get(IEditorService);
|
|
629
|
+
const notificationService = accessor.get(INotificationService);
|
|
630
|
+
const extensionService = accessor.get(IExtensionService);
|
|
631
|
+
const telemetryService = accessor.get(ITelemetryService);
|
|
632
|
+
const ext = await extensionService.getExtension(HEX_EDITOR_EXTENSION_ID);
|
|
633
|
+
if (ext || (await tryInstallHexEditor(extensionsWorkbenchService, notificationService))) {
|
|
634
|
+
telemetryService.publicLog('debug/didViewMemory', {
|
|
635
|
+
debugType: debugService.getModel().getSession(sessionId)?.configuration.type,
|
|
636
|
+
});
|
|
637
|
+
await editorService.openEditor({
|
|
638
|
+
resource: getUriForDebugMemory(sessionId, memoryReference),
|
|
639
|
+
options: {
|
|
640
|
+
revealIfOpened: true,
|
|
641
|
+
override: HEX_EDITOR_EDITOR_ID,
|
|
642
|
+
},
|
|
643
|
+
}, SIDE_GROUP);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
async function tryInstallHexEditor(extensionsWorkbenchService, notificationService) {
|
|
648
|
+
try {
|
|
649
|
+
await extensionsWorkbenchService.install(HEX_EDITOR_EXTENSION_ID, {
|
|
650
|
+
justification: ( localizeWithPath(
|
|
651
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
652
|
+
"viewMemory.prompt",
|
|
653
|
+
"Inspecting binary data requires this extension."
|
|
654
|
+
)),
|
|
655
|
+
enable: true
|
|
656
|
+
}, 15 );
|
|
657
|
+
return true;
|
|
658
|
+
}
|
|
659
|
+
catch (error) {
|
|
660
|
+
notificationService.error(error);
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
const BREAK_WHEN_VALUE_CHANGES_ID = 'debug.breakWhenValueChanges';
|
|
665
|
+
CommandsRegistry.registerCommand({
|
|
666
|
+
id: BREAK_WHEN_VALUE_CHANGES_ID,
|
|
667
|
+
handler: async (accessor) => {
|
|
668
|
+
const debugService = accessor.get(IDebugService);
|
|
669
|
+
if (dataBreakpointInfoResponse) {
|
|
670
|
+
await debugService.addDataBreakpoint({ description: dataBreakpointInfoResponse.description, src: { type: 0 , dataId: dataBreakpointInfoResponse.dataId }, canPersist: !!dataBreakpointInfoResponse.canPersist, accessTypes: dataBreakpointInfoResponse.accessTypes, accessType: 'write' });
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
const BREAK_WHEN_VALUE_IS_ACCESSED_ID = 'debug.breakWhenValueIsAccessed';
|
|
675
|
+
CommandsRegistry.registerCommand({
|
|
676
|
+
id: BREAK_WHEN_VALUE_IS_ACCESSED_ID,
|
|
677
|
+
handler: async (accessor) => {
|
|
678
|
+
const debugService = accessor.get(IDebugService);
|
|
679
|
+
if (dataBreakpointInfoResponse) {
|
|
680
|
+
await debugService.addDataBreakpoint({ description: dataBreakpointInfoResponse.description, src: { type: 0 , dataId: dataBreakpointInfoResponse.dataId }, canPersist: !!dataBreakpointInfoResponse.canPersist, accessTypes: dataBreakpointInfoResponse.accessTypes, accessType: 'readWrite' });
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
const BREAK_WHEN_VALUE_IS_READ_ID = 'debug.breakWhenValueIsRead';
|
|
685
|
+
CommandsRegistry.registerCommand({
|
|
686
|
+
id: BREAK_WHEN_VALUE_IS_READ_ID,
|
|
687
|
+
handler: async (accessor) => {
|
|
688
|
+
const debugService = accessor.get(IDebugService);
|
|
689
|
+
if (dataBreakpointInfoResponse) {
|
|
690
|
+
await debugService.addDataBreakpoint({ description: dataBreakpointInfoResponse.description, src: { type: 0 , dataId: dataBreakpointInfoResponse.dataId }, canPersist: !!dataBreakpointInfoResponse.canPersist, accessTypes: dataBreakpointInfoResponse.accessTypes, accessType: 'read' });
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
const COPY_EVALUATE_PATH_ID = 'debug.copyEvaluatePath';
|
|
695
|
+
CommandsRegistry.registerCommand({
|
|
696
|
+
id: COPY_EVALUATE_PATH_ID,
|
|
697
|
+
handler: async (accessor, context) => {
|
|
698
|
+
const clipboardService = accessor.get(IClipboardService);
|
|
699
|
+
await clipboardService.writeText(context.variable.evaluateName);
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
const ADD_TO_WATCH_ID = 'debug.addToWatchExpressions';
|
|
703
|
+
CommandsRegistry.registerCommand({
|
|
704
|
+
id: ADD_TO_WATCH_ID,
|
|
705
|
+
handler: async (accessor, context) => {
|
|
706
|
+
const debugService = accessor.get(IDebugService);
|
|
707
|
+
debugService.addWatchExpression(context.variable.evaluateName);
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
registerAction2(class extends ViewAction {
|
|
711
|
+
constructor() {
|
|
712
|
+
super({
|
|
713
|
+
id: 'variables.collapse',
|
|
714
|
+
viewId: VARIABLES_VIEW_ID,
|
|
715
|
+
title: ( localizeWithPath(
|
|
716
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
717
|
+
'collapse',
|
|
718
|
+
"Collapse All"
|
|
719
|
+
)),
|
|
720
|
+
f1: false,
|
|
721
|
+
icon: Codicon.collapseAll,
|
|
722
|
+
menu: {
|
|
723
|
+
id: MenuId.ViewTitle,
|
|
724
|
+
group: 'navigation',
|
|
725
|
+
when: ( ContextKeyExpr.equals('view', VARIABLES_VIEW_ID))
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
runInView(_accessor, view) {
|
|
730
|
+
view.collapseAll();
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
export { ADD_TO_WATCH_ID, BREAK_WHEN_VALUE_CHANGES_ID, BREAK_WHEN_VALUE_IS_ACCESSED_ID, BREAK_WHEN_VALUE_IS_READ_ID, COPY_EVALUATE_PATH_ID, COPY_VALUE_ID, SET_VARIABLE_ID, VIEW_MEMORY_ID, VariablesRenderer, VariablesView, VisualizedVariableRenderer, openContextMenuForVariableTreeElement };
|