@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.
Files changed (60) hide show
  1. package/debug.js +4 -4
  2. package/package.json +2 -2
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  6. package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +0 -73
  7. package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +0 -1011
  8. package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +0 -970
  9. package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +0 -347
  10. package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +0 -324
  11. package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +0 -432
  12. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +0 -1039
  13. package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +0 -649
  14. package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +0 -64
  15. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +0 -636
  16. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +0 -725
  17. package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +0 -398
  18. package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +0 -206
  19. package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +0 -80
  20. package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +0 -169
  21. package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +0 -1271
  22. package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +0 -1305
  23. package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +0 -115
  24. package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +0 -77
  25. package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +0 -307
  26. package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +0 -31
  27. package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +0 -378
  28. package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +0 -267
  29. package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +0 -808
  30. package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +0 -121
  31. package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +0 -141
  32. package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +0 -262
  33. package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +0 -669
  34. package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +0 -6
  35. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +0 -6
  36. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +0 -6
  37. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +0 -6
  38. package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +0 -6
  39. package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +0 -6
  40. package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +0 -709
  41. package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +0 -992
  42. package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +0 -48
  43. package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +0 -348
  44. package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +0 -119
  45. package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +0 -763
  46. package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +0 -501
  47. package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +0 -162
  48. package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +0 -21
  49. package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +0 -17
  50. package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +0 -110
  51. package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +0 -62
  52. package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +0 -460
  53. package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +0 -162
  54. package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +0 -36
  55. package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +0 -148
  56. package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +0 -289
  57. package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +0 -87
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +0 -64
  59. package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +0 -311
  60. package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +0 -28
@@ -1,501 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { ElementsDragAndDropData } from 'vscode/vscode/vs/base/browser/ui/list/listView';
3
- import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
4
- import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
5
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
6
- import { createAndFillInContextMenuActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
7
- import { MenuId, registerAction2, Action2, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
8
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
9
- import { ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
10
- import { IContextMenuService, IContextViewService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
11
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
12
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
13
- import { WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
14
- import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
15
- import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
16
- import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
17
- import { ViewAction, ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
18
- import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
19
- import { AbstractExpressionsRenderer, renderExpressionValue, renderViewTree, AbstractExpressionDataSource } from 'vscode/vscode/vs/workbench/contrib/debug/browser/baseDebugView';
20
- import { watchExpressionsAdd, watchExpressionsRemoveAll } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
21
- import { LinkDetector } from './linkDetector.js';
22
- import { VariablesRenderer, VisualizedVariableRenderer } from './variablesView.js';
23
- import { CONTEXT_CAN_VIEW_MEMORY, CONTEXT_WATCH_ITEM_TYPE, WATCH_VIEW_ID, CONTEXT_WATCH_EXPRESSIONS_EXIST, IDebugService, CONTEXT_VARIABLE_IS_READONLY, CONTEXT_WATCH_EXPRESSIONS_FOCUSED } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
24
- import { Variable, Expression, VisualizedExpression } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
25
-
26
- var WatchExpressionsRenderer_1;
27
- const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024;
28
- let ignoreViewUpdates = false;
29
- let useCachedEvaluation = false;
30
- let WatchExpressionsView = class WatchExpressionsView extends ViewPane {
31
- constructor(options, contextMenuService, debugService, keybindingService, instantiationService, viewDescriptorService, configurationService, contextKeyService, openerService, themeService, telemetryService, menuService) {
32
- super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
33
- this.debugService = debugService;
34
- this.needsRefresh = false;
35
- this.menu = menuService.createMenu(MenuId.DebugWatchContext, contextKeyService);
36
- this._register(this.menu);
37
- this.watchExpressionsUpdatedScheduler = ( new RunOnceScheduler(() => {
38
- this.needsRefresh = false;
39
- this.tree.updateChildren();
40
- }, 50));
41
- this.watchExpressionsExist = CONTEXT_WATCH_EXPRESSIONS_EXIST.bindTo(contextKeyService);
42
- this.variableReadonly = CONTEXT_VARIABLE_IS_READONLY.bindTo(contextKeyService);
43
- this.watchExpressionsExist.set(this.debugService.getModel().getWatchExpressions().length > 0);
44
- this.watchItemType = CONTEXT_WATCH_ITEM_TYPE.bindTo(contextKeyService);
45
- }
46
- renderBody(container) {
47
- super.renderBody(container);
48
- this.element.classList.add('debug-pane');
49
- container.classList.add('debug-watch');
50
- const treeContainer = renderViewTree(container);
51
- const expressionsRenderer = this.instantiationService.createInstance(WatchExpressionsRenderer);
52
- const linkDetector = this.instantiationService.createInstance(LinkDetector);
53
- this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'WatchExpressions', treeContainer, ( new WatchExpressionsDelegate()), [
54
- expressionsRenderer,
55
- this.instantiationService.createInstance(VariablesRenderer, linkDetector),
56
- this.instantiationService.createInstance(VisualizedVariableRenderer, linkDetector),
57
- ], this.instantiationService.createInstance(WatchExpressionsDataSource), {
58
- accessibilityProvider: ( new WatchExpressionsAccessibilityProvider()),
59
- identityProvider: { getId: (element) => element.getId() },
60
- keyboardNavigationLabelProvider: {
61
- getKeyboardNavigationLabel: (e) => {
62
- if (e === this.debugService.getViewModel().getSelectedExpression()?.expression) {
63
- return undefined;
64
- }
65
- return e.name;
66
- }
67
- },
68
- dnd: ( new WatchExpressionsDragAndDrop(this.debugService)),
69
- overrideStyles: {
70
- listBackground: this.getBackgroundColor()
71
- }
72
- });
73
- this.tree.setInput(this.debugService);
74
- CONTEXT_WATCH_EXPRESSIONS_FOCUSED.bindTo(this.tree.contextKeyService);
75
- this._register(VisualizedVariableRenderer.rendererOnVisualizationRange(this.debugService.getViewModel(), this.tree));
76
- this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
77
- this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
78
- this._register(this.debugService.getModel().onDidChangeWatchExpressions(async (we) => {
79
- this.watchExpressionsExist.set(this.debugService.getModel().getWatchExpressions().length > 0);
80
- if (!this.isBodyVisible()) {
81
- this.needsRefresh = true;
82
- }
83
- else {
84
- if (we && !we.name) {
85
- useCachedEvaluation = true;
86
- }
87
- await this.tree.updateChildren();
88
- useCachedEvaluation = false;
89
- if (we instanceof Expression) {
90
- this.tree.reveal(we);
91
- }
92
- }
93
- }));
94
- this._register(this.debugService.getViewModel().onDidFocusStackFrame(() => {
95
- if (!this.isBodyVisible()) {
96
- this.needsRefresh = true;
97
- return;
98
- }
99
- if (!this.watchExpressionsUpdatedScheduler.isScheduled()) {
100
- this.watchExpressionsUpdatedScheduler.schedule();
101
- }
102
- }));
103
- this._register(this.debugService.getViewModel().onWillUpdateViews(() => {
104
- if (!ignoreViewUpdates) {
105
- this.tree.updateChildren();
106
- }
107
- }));
108
- this._register(this.onDidChangeBodyVisibility(visible => {
109
- if (visible && this.needsRefresh) {
110
- this.watchExpressionsUpdatedScheduler.schedule();
111
- }
112
- }));
113
- let horizontalScrolling;
114
- this._register(this.debugService.getViewModel().onDidSelectExpression(e => {
115
- const expression = e?.expression;
116
- if (expression && this.tree.hasElement(expression)) {
117
- horizontalScrolling = this.tree.options.horizontalScrolling;
118
- if (horizontalScrolling) {
119
- this.tree.updateOptions({ horizontalScrolling: false });
120
- }
121
- if (expression.name) {
122
- this.tree.rerender(expression);
123
- }
124
- }
125
- else if (!expression && horizontalScrolling !== undefined) {
126
- this.tree.updateOptions({ horizontalScrolling: horizontalScrolling });
127
- horizontalScrolling = undefined;
128
- }
129
- }));
130
- this._register(this.debugService.getViewModel().onDidEvaluateLazyExpression(async (e) => {
131
- if (e instanceof Variable && this.tree.hasNode(e)) {
132
- await this.tree.updateChildren(e, false, true);
133
- await this.tree.expand(e);
134
- }
135
- }));
136
- }
137
- layoutBody(height, width) {
138
- super.layoutBody(height, width);
139
- this.tree.layout(height, width);
140
- }
141
- focus() {
142
- super.focus();
143
- this.tree.domFocus();
144
- }
145
- collapseAll() {
146
- this.tree.collapseAll();
147
- }
148
- onMouseDblClick(e) {
149
- if (e.browserEvent.target.className.indexOf('twistie') >= 0) {
150
- return;
151
- }
152
- const element = e.element;
153
- const selectedExpression = this.debugService.getViewModel().getSelectedExpression();
154
- if ((element instanceof Expression && element !== selectedExpression?.expression) || (element instanceof VisualizedExpression && element.treeItem.canEdit)) {
155
- this.debugService.getViewModel().setSelectedExpression(element, false);
156
- }
157
- else if (!element) {
158
- this.debugService.addWatchExpression();
159
- }
160
- }
161
- onContextMenu(e) {
162
- const element = e.element;
163
- const selection = this.tree.getSelection();
164
- this.watchItemType.set(element instanceof Expression ? 'expression' : element instanceof Variable ? 'variable' : undefined);
165
- const actions = [];
166
- const attributes = element instanceof Variable ? element.presentationHint?.attributes : undefined;
167
- this.variableReadonly.set(!!attributes && attributes.indexOf('readOnly') >= 0 || !!element?.presentationHint?.lazy);
168
- createAndFillInContextMenuActions(this.menu, { arg: element, shouldForwardArgs: true }, actions);
169
- this.contextMenuService.showContextMenu({
170
- getAnchor: () => e.anchor,
171
- getActions: () => actions,
172
- getActionsContext: () => element && selection.includes(element) ? selection : element ? [element] : [],
173
- });
174
- }
175
- };
176
- WatchExpressionsView = ( __decorate([
177
- ( __param(1, IContextMenuService)),
178
- ( __param(2, IDebugService)),
179
- ( __param(3, IKeybindingService)),
180
- ( __param(4, IInstantiationService)),
181
- ( __param(5, IViewDescriptorService)),
182
- ( __param(6, IConfigurationService)),
183
- ( __param(7, IContextKeyService)),
184
- ( __param(8, IOpenerService)),
185
- ( __param(9, IThemeService)),
186
- ( __param(10, ITelemetryService)),
187
- ( __param(11, IMenuService))
188
- ], WatchExpressionsView));
189
- class WatchExpressionsDelegate {
190
- getHeight(_element) {
191
- return 22;
192
- }
193
- getTemplateId(element) {
194
- if (element instanceof Expression) {
195
- return WatchExpressionsRenderer.ID;
196
- }
197
- if (element instanceof VisualizedExpression) {
198
- return VisualizedVariableRenderer.ID;
199
- }
200
- return VariablesRenderer.ID;
201
- }
202
- }
203
- function isDebugService(element) {
204
- return typeof element.getConfigurationManager === 'function';
205
- }
206
- class WatchExpressionsDataSource extends AbstractExpressionDataSource {
207
- hasChildren(element) {
208
- return isDebugService(element) || element.hasChildren;
209
- }
210
- doGetChildren(element) {
211
- if (isDebugService(element)) {
212
- const debugService = element;
213
- const watchExpressions = debugService.getModel().getWatchExpressions();
214
- const viewModel = debugService.getViewModel();
215
- return Promise.all(( watchExpressions.map(we => !!we.name && !useCachedEvaluation
216
- ? we.evaluate(viewModel.focusedSession, viewModel.focusedStackFrame, 'watch').then(() => we)
217
- : Promise.resolve(we))));
218
- }
219
- return element.getChildren();
220
- }
221
- }
222
- let WatchExpressionsRenderer = class WatchExpressionsRenderer extends AbstractExpressionsRenderer {
223
- static { WatchExpressionsRenderer_1 = this; }
224
- static { this.ID = 'watchexpression'; }
225
- constructor(menuService, contextKeyService, debugService, contextViewService) {
226
- super(debugService, contextViewService);
227
- this.menuService = menuService;
228
- this.contextKeyService = contextKeyService;
229
- }
230
- get templateId() {
231
- return WatchExpressionsRenderer_1.ID;
232
- }
233
- renderElement(node, index, data) {
234
- super.renderExpressionElement(node.element, node, data);
235
- }
236
- renderExpression(expression, data, highlights) {
237
- const text = typeof expression.value === 'string' ? `${expression.name}:` : expression.name;
238
- let title;
239
- if (expression.type) {
240
- title = expression.type === expression.value ?
241
- expression.type :
242
- `${expression.type}: ${expression.value}`;
243
- }
244
- else {
245
- title = expression.value;
246
- }
247
- data.label.set(text, highlights, title);
248
- renderExpressionValue(expression, data.value, {
249
- showChanged: true,
250
- maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_VIEWLET,
251
- showHover: true,
252
- colorize: true
253
- });
254
- }
255
- getInputBoxOptions(expression, settingValue) {
256
- if (settingValue) {
257
- return {
258
- initialValue: expression.value,
259
- ariaLabel: ( localizeWithPath(
260
- 'vs/workbench/contrib/debug/browser/watchExpressionsView',
261
- 'typeNewValue',
262
- "Type new value"
263
- )),
264
- onFinish: async (value, success) => {
265
- if (success && value) {
266
- const focusedFrame = this.debugService.getViewModel().focusedStackFrame;
267
- if (focusedFrame && (expression instanceof Variable || expression instanceof Expression)) {
268
- await expression.setExpression(value, focusedFrame);
269
- this.debugService.getViewModel().updateViews();
270
- }
271
- }
272
- }
273
- };
274
- }
275
- return {
276
- initialValue: expression.name ? expression.name : '',
277
- ariaLabel: ( localizeWithPath(
278
- 'vs/workbench/contrib/debug/browser/watchExpressionsView',
279
- 'watchExpressionInputAriaLabel',
280
- "Type watch expression"
281
- )),
282
- placeholder: ( localizeWithPath(
283
- 'vs/workbench/contrib/debug/browser/watchExpressionsView',
284
- 'watchExpressionPlaceholder',
285
- "Expression to watch"
286
- )),
287
- onFinish: (value, success) => {
288
- if (success && value) {
289
- this.debugService.renameWatchExpression(expression.getId(), value);
290
- ignoreViewUpdates = true;
291
- this.debugService.getViewModel().updateViews();
292
- ignoreViewUpdates = false;
293
- }
294
- else if (!expression.name) {
295
- this.debugService.removeWatchExpressions(expression.getId());
296
- }
297
- }
298
- };
299
- }
300
- renderActionBar(actionBar, expression) {
301
- const contextKeyService = getContextForWatchExpressionMenu(this.contextKeyService, expression);
302
- const menu = this.menuService.createMenu(MenuId.DebugWatchContext, contextKeyService);
303
- const primary = [];
304
- const context = expression;
305
- createAndFillInContextMenuActions(menu, { arg: context, shouldForwardArgs: false }, { primary, secondary: [] }, 'inline');
306
- actionBar.clear();
307
- actionBar.context = context;
308
- actionBar.push(primary, { icon: true, label: false });
309
- }
310
- };
311
- WatchExpressionsRenderer = WatchExpressionsRenderer_1 = ( __decorate([
312
- ( __param(0, IMenuService)),
313
- ( __param(1, IContextKeyService)),
314
- ( __param(2, IDebugService)),
315
- ( __param(3, IContextViewService))
316
- ], WatchExpressionsRenderer));
317
- function getContextForWatchExpressionMenu(parentContext, expression) {
318
- return parentContext.createOverlay([
319
- [CONTEXT_CAN_VIEW_MEMORY.key, expression.memoryReference !== undefined],
320
- [CONTEXT_WATCH_ITEM_TYPE.key, 'expression']
321
- ]);
322
- }
323
- class WatchExpressionsAccessibilityProvider {
324
- getWidgetAriaLabel() {
325
- return ( localizeWithPath(
326
- 'vs/workbench/contrib/debug/browser/watchExpressionsView',
327
- { comment: ['Debug is a noun in this context, not a verb.'], key: 'watchAriaTreeLabel' },
328
- "Debug Watch Expressions"
329
- ));
330
- }
331
- getAriaLabel(element) {
332
- if (element instanceof Expression) {
333
- return ( localizeWithPath(
334
- 'vs/workbench/contrib/debug/browser/watchExpressionsView',
335
- 'watchExpressionAriaLabel',
336
- "{0}, value {1}",
337
- element.name,
338
- element.value
339
- ));
340
- }
341
- return ( localizeWithPath(
342
- 'vs/workbench/contrib/debug/browser/watchExpressionsView',
343
- 'watchVariableAriaLabel',
344
- "{0}, value {1}",
345
- element.name,
346
- element.value
347
- ));
348
- }
349
- }
350
- class WatchExpressionsDragAndDrop {
351
- constructor(debugService) {
352
- this.debugService = debugService;
353
- }
354
- onDragOver(data, targetElement, targetIndex, targetSector, originalEvent) {
355
- if (!(data instanceof ElementsDragAndDropData)) {
356
- return false;
357
- }
358
- const expressions = data.elements;
359
- if (!(expressions.length > 0 && expressions[0] instanceof Expression)) {
360
- return false;
361
- }
362
- let dropEffectPosition = undefined;
363
- if (targetIndex === undefined) {
364
- dropEffectPosition = "drop-target-after" ;
365
- targetIndex = -1;
366
- }
367
- else {
368
- switch (targetSector) {
369
- case 0 :
370
- case 1 :
371
- dropEffectPosition = "drop-target-before" ;
372
- break;
373
- case 2 :
374
- case 3 :
375
- dropEffectPosition = "drop-target-after" ;
376
- break;
377
- }
378
- }
379
- return { accept: true, effect: { type: 1 , position: dropEffectPosition }, feedback: [targetIndex] };
380
- }
381
- getDragURI(element) {
382
- if (!(element instanceof Expression) || element === this.debugService.getViewModel().getSelectedExpression()?.expression) {
383
- return null;
384
- }
385
- return element.getId();
386
- }
387
- getDragLabel(elements) {
388
- if (elements.length === 1) {
389
- return elements[0].name;
390
- }
391
- return undefined;
392
- }
393
- drop(data, targetElement, targetIndex, targetSector, originalEvent) {
394
- if (!(data instanceof ElementsDragAndDropData)) {
395
- return;
396
- }
397
- const draggedElement = data.elements[0];
398
- if (!(draggedElement instanceof Expression)) {
399
- throw new Error('Invalid dragged element');
400
- }
401
- const watches = this.debugService.getModel().getWatchExpressions();
402
- const sourcePosition = watches.indexOf(draggedElement);
403
- let targetPosition;
404
- if (targetElement instanceof Expression) {
405
- targetPosition = watches.indexOf(targetElement);
406
- switch (targetSector) {
407
- case 3 :
408
- case 2 :
409
- targetPosition++;
410
- break;
411
- }
412
- if (sourcePosition < targetPosition) {
413
- targetPosition--;
414
- }
415
- }
416
- else {
417
- targetPosition = watches.length - 1;
418
- }
419
- this.debugService.moveWatchExpression(draggedElement.getId(), targetPosition);
420
- }
421
- dispose() { }
422
- }
423
- registerAction2(class Collapse extends ViewAction {
424
- constructor() {
425
- super({
426
- id: 'watch.collapse',
427
- viewId: WATCH_VIEW_ID,
428
- title: ( localizeWithPath(
429
- 'vs/workbench/contrib/debug/browser/watchExpressionsView',
430
- 'collapse',
431
- "Collapse All"
432
- )),
433
- f1: false,
434
- icon: Codicon.collapseAll,
435
- precondition: CONTEXT_WATCH_EXPRESSIONS_EXIST,
436
- menu: {
437
- id: MenuId.ViewTitle,
438
- order: 30,
439
- group: 'navigation',
440
- when: ( ContextKeyExpr.equals('view', WATCH_VIEW_ID))
441
- }
442
- });
443
- }
444
- runInView(_accessor, view) {
445
- view.collapseAll();
446
- }
447
- });
448
- const ADD_WATCH_ID = 'workbench.debug.viewlet.action.addWatchExpression';
449
- const ADD_WATCH_LABEL = ( localizeWithPath(
450
- 'vs/workbench/contrib/debug/browser/watchExpressionsView',
451
- 'addWatchExpression',
452
- "Add Expression"
453
- ));
454
- registerAction2(class AddWatchExpressionAction extends Action2 {
455
- constructor() {
456
- super({
457
- id: ADD_WATCH_ID,
458
- title: ADD_WATCH_LABEL,
459
- f1: false,
460
- icon: watchExpressionsAdd,
461
- menu: {
462
- id: MenuId.ViewTitle,
463
- group: 'navigation',
464
- when: ( ContextKeyExpr.equals('view', WATCH_VIEW_ID))
465
- }
466
- });
467
- }
468
- run(accessor) {
469
- const debugService = accessor.get(IDebugService);
470
- debugService.addWatchExpression();
471
- }
472
- });
473
- const REMOVE_WATCH_EXPRESSIONS_COMMAND_ID = 'workbench.debug.viewlet.action.removeAllWatchExpressions';
474
- const REMOVE_WATCH_EXPRESSIONS_LABEL = ( localizeWithPath(
475
- 'vs/workbench/contrib/debug/browser/watchExpressionsView',
476
- 'removeAllWatchExpressions',
477
- "Remove All Expressions"
478
- ));
479
- registerAction2(class RemoveAllWatchExpressionsAction extends Action2 {
480
- constructor() {
481
- super({
482
- id: REMOVE_WATCH_EXPRESSIONS_COMMAND_ID,
483
- title: REMOVE_WATCH_EXPRESSIONS_LABEL,
484
- f1: false,
485
- icon: watchExpressionsRemoveAll,
486
- precondition: CONTEXT_WATCH_EXPRESSIONS_EXIST,
487
- menu: {
488
- id: MenuId.ViewTitle,
489
- order: 20,
490
- group: 'navigation',
491
- when: ( ContextKeyExpr.equals('view', WATCH_VIEW_ID))
492
- }
493
- });
494
- }
495
- run(accessor) {
496
- const debugService = accessor.get(IDebugService);
497
- debugService.removeWatchExpressions();
498
- }
499
- });
500
-
501
- export { ADD_WATCH_ID, ADD_WATCH_LABEL, REMOVE_WATCH_EXPRESSIONS_COMMAND_ID, REMOVE_WATCH_EXPRESSIONS_LABEL, WatchExpressionsView };
@@ -1,162 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
3
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
4
- import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
5
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
6
- import { RawContextKey, ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
7
- import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
8
- import { CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_EXTENSION_AVAILABLE, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
9
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
10
- import { ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
11
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
12
- import { Extensions, ViewContentGroups, IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
13
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
14
- import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
15
- import { WorkbenchStateContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
16
- import { OpenFileFolderAction, OpenFileAction, OpenFolderAction } from 'vscode/vscode/vs/workbench/browser/actions/workspaceActions';
17
- import { isMacintosh, isWeb } from 'vscode/vscode/vs/base/common/platform';
18
- import { isDiffEditor, isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
19
- import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
20
- import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
21
- import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
22
- import { DEBUG_START_COMMAND_ID, SELECT_AND_START_ID, DEBUG_CONFIGURE_COMMAND_ID } from './debugCommands.js';
23
-
24
- const debugStartLanguageKey = 'debugStartLanguage';
25
- const CONTEXT_DEBUG_START_LANGUAGE = ( new RawContextKey(debugStartLanguageKey, undefined));
26
- const CONTEXT_DEBUGGER_INTERESTED_IN_ACTIVE_EDITOR = ( new RawContextKey('debuggerInterestedInActiveEditor', false));
27
- let WelcomeView = class WelcomeView extends ViewPane {
28
- static { this.ID = 'workbench.debug.welcome'; }
29
- static { this.LABEL = ( localize2WithPath('vs/workbench/contrib/debug/browser/welcomeView', 'run', "Run")); }
30
- constructor(options, themeService, keybindingService, contextMenuService, configurationService, contextKeyService, debugService, editorService, instantiationService, viewDescriptorService, openerService, storageSevice, telemetryService) {
31
- super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
32
- this.debugService = debugService;
33
- this.editorService = editorService;
34
- this.debugStartLanguageContext = CONTEXT_DEBUG_START_LANGUAGE.bindTo(contextKeyService);
35
- this.debuggerInterestedContext = CONTEXT_DEBUGGER_INTERESTED_IN_ACTIVE_EDITOR.bindTo(contextKeyService);
36
- const lastSetLanguage = storageSevice.get(debugStartLanguageKey, 1 );
37
- this.debugStartLanguageContext.set(lastSetLanguage);
38
- const setContextKey = () => {
39
- let editorControl = this.editorService.activeTextEditorControl;
40
- if (isDiffEditor(editorControl)) {
41
- editorControl = editorControl.getModifiedEditor();
42
- }
43
- if (isCodeEditor(editorControl)) {
44
- const model = editorControl.getModel();
45
- const language = model ? model.getLanguageId() : undefined;
46
- if (language && this.debugService.getAdapterManager().someDebuggerInterestedInLanguage(language)) {
47
- this.debugStartLanguageContext.set(language);
48
- this.debuggerInterestedContext.set(true);
49
- storageSevice.store(debugStartLanguageKey, language, 1 , 1 );
50
- return;
51
- }
52
- }
53
- this.debuggerInterestedContext.set(false);
54
- };
55
- const disposables = ( new DisposableStore());
56
- this._register(disposables);
57
- this._register(editorService.onDidActiveEditorChange(() => {
58
- disposables.clear();
59
- let editorControl = this.editorService.activeTextEditorControl;
60
- if (isDiffEditor(editorControl)) {
61
- editorControl = editorControl.getModifiedEditor();
62
- }
63
- if (isCodeEditor(editorControl)) {
64
- disposables.add(editorControl.onDidChangeModelLanguage(setContextKey));
65
- }
66
- setContextKey();
67
- }));
68
- this._register(this.debugService.getAdapterManager().onDidRegisterDebugger(setContextKey));
69
- this._register(this.onDidChangeBodyVisibility(visible => {
70
- if (visible) {
71
- setContextKey();
72
- }
73
- }));
74
- setContextKey();
75
- const debugKeybinding = this.keybindingService.lookupKeybinding(DEBUG_START_COMMAND_ID);
76
- debugKeybindingLabel = debugKeybinding ? ` (${debugKeybinding.getLabel()})` : '';
77
- }
78
- shouldShowWelcome() {
79
- return true;
80
- }
81
- };
82
- WelcomeView = ( __decorate([
83
- ( __param(1, IThemeService)),
84
- ( __param(2, IKeybindingService)),
85
- ( __param(3, IContextMenuService)),
86
- ( __param(4, IConfigurationService)),
87
- ( __param(5, IContextKeyService)),
88
- ( __param(6, IDebugService)),
89
- ( __param(7, IEditorService)),
90
- ( __param(8, IInstantiationService)),
91
- ( __param(9, IViewDescriptorService)),
92
- ( __param(10, IOpenerService)),
93
- ( __param(11, IStorageService)),
94
- ( __param(12, ITelemetryService))
95
- ], WelcomeView));
96
- const viewsRegistry = ( Registry.as(Extensions.ViewsRegistry));
97
- viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
98
- content: ( localizeWithPath('vs/workbench/contrib/debug/browser/welcomeView', {
99
- key: 'openAFileWhichCanBeDebugged',
100
- comment: [
101
- 'Please do not translate the word "command", it is part of our internal syntax which must not change',
102
- '{Locked="](command:{0})"}'
103
- ]
104
- }, "[Open a file](command:{0}) which can be debugged or run.", (isMacintosh && !isWeb) ? OpenFileFolderAction.ID : OpenFileAction.ID)),
105
- when: ( ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, ( CONTEXT_DEBUGGER_INTERESTED_IN_ACTIVE_EDITOR.toNegated()))),
106
- group: ViewContentGroups.Open,
107
- });
108
- let debugKeybindingLabel = '';
109
- viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
110
- content: `[${( localizeWithPath(
111
- 'vs/workbench/contrib/debug/browser/welcomeView',
112
- 'runAndDebugAction',
113
- "Run and Debug"
114
- ))}${debugKeybindingLabel}](command:${DEBUG_START_COMMAND_ID})`,
115
- when: CONTEXT_DEBUGGERS_AVAILABLE,
116
- group: ViewContentGroups.Debug,
117
- order: 1
118
- });
119
- viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
120
- content: `[${( localizeWithPath(
121
- 'vs/workbench/contrib/debug/browser/welcomeView',
122
- 'detectThenRunAndDebug',
123
- "Show all automatic debug configurations"
124
- ))}](command:${SELECT_AND_START_ID}).`,
125
- when: CONTEXT_DEBUGGERS_AVAILABLE,
126
- group: ViewContentGroups.Debug,
127
- order: 10
128
- });
129
- viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
130
- content: ( localizeWithPath('vs/workbench/contrib/debug/browser/welcomeView', {
131
- key: 'customizeRunAndDebug',
132
- comment: [
133
- 'Please do not translate the word "command", it is part of our internal syntax which must not change',
134
- '{Locked="](command:{0})"}'
135
- ]
136
- }, "To customize Run and Debug [create a launch.json file](command:{0}).", DEBUG_CONFIGURE_COMMAND_ID)),
137
- when: ( ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, ( WorkbenchStateContext.notEqualsTo('empty')))),
138
- group: ViewContentGroups.Debug
139
- });
140
- viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
141
- content: ( localizeWithPath('vs/workbench/contrib/debug/browser/welcomeView', {
142
- key: 'customizeRunAndDebugOpenFolder',
143
- comment: [
144
- 'Please do not translate the word "command", it is part of our internal syntax which must not change',
145
- 'Please do not translate "launch.json", it is the specific configuration file name',
146
- '{Locked="](command:{0})"}',
147
- ]
148
- }, "To customize Run and Debug, [open a folder](command:{0}) and create a launch.json file.", (isMacintosh && !isWeb) ? OpenFileFolderAction.ID : OpenFolderAction.ID)),
149
- when: ( ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, ( WorkbenchStateContext.isEqualTo('empty')))),
150
- group: ViewContentGroups.Debug
151
- });
152
- viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
153
- content: ( localizeWithPath(
154
- 'vs/workbench/contrib/debug/browser/welcomeView',
155
- 'allDebuggersDisabled',
156
- "All debug extensions are disabled. Enable a debug extension or install a new one from the Marketplace."
157
- )),
158
- when: ( CONTEXT_DEBUG_EXTENSION_AVAILABLE.toNegated()),
159
- group: ViewContentGroups.Debug
160
- });
161
-
162
- export { WelcomeView };