@codingame/monaco-vscode-debug-service-override 1.82.4 → 1.82.5-next.1

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 (73) hide show
  1. package/debug.d.ts +5 -0
  2. package/debug.js +24 -0
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
  4. package/external/tslib/tslib.es6.js +11 -0
  5. package/index.d.ts +1 -1
  6. package/index.js +1 -1
  7. package/override/vs/platform/dialogs/common/dialogs.js +8 -0
  8. package/package.json +2 -2
  9. package/vscode/src/vs/editor/common/services/languageFeaturesService.js +44 -0
  10. package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +200 -0
  11. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +785 -0
  12. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +399 -0
  13. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1298 -0
  14. package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
  15. package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +960 -0
  16. package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +497 -0
  17. package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +347 -0
  18. package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +299 -0
  19. package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +400 -0
  20. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +827 -0
  21. package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +621 -0
  22. package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +60 -0
  23. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +527 -0
  24. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +681 -0
  25. package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +356 -0
  26. package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +206 -0
  27. package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +82 -0
  28. package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +143 -0
  29. package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +1174 -0
  30. package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +1144 -0
  31. package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +106 -0
  32. package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +68 -0
  33. package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +275 -0
  34. package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +314 -0
  35. package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +168 -0
  36. package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +663 -0
  37. package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +105 -0
  38. package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +231 -0
  39. package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +631 -0
  40. package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +6 -0
  41. package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +6 -0
  42. package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +6 -0
  43. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +6 -0
  44. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +6 -0
  45. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +6 -0
  46. package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +6 -0
  47. package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +6 -0
  48. package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +695 -0
  49. package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +953 -0
  50. package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +48 -0
  51. package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +336 -0
  52. package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +98 -0
  53. package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +575 -0
  54. package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +415 -0
  55. package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +102 -0
  56. package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +21 -0
  57. package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +17 -0
  58. package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +100 -0
  59. package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +59 -0
  60. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1482 -0
  61. package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +346 -0
  62. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +123 -0
  63. package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +175 -0
  64. package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +36 -0
  65. package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +117 -0
  66. package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +260 -0
  67. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +27 -0
  68. package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +83 -0
  69. package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +283 -0
  70. package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +305 -0
  71. package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +28 -0
  72. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +176 -0
  73. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +12 -0
@@ -0,0 +1,415 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
3
+ 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';
4
+ import { Variable, Expression } from '../common/debugModel.js';
5
+ import { IContextMenuService, IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
6
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
7
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
8
+ import { AbstractExpressionsRenderer, renderExpressionValue, renderViewTree } from './baseDebugView.js';
9
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
10
+ import { ViewAction, ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
11
+ import { WorkbenchAsyncDataTree } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
12
+ import { ElementsDragAndDropData } from 'monaco-editor/esm/vs/base/browser/ui/list/listView.js';
13
+ import { VariablesRenderer } from './variablesView.js';
14
+ import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
15
+ import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
16
+ import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
17
+ import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
18
+ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
19
+ import { watchExpressionsAdd, watchExpressionsRemoveAll } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
20
+ import { MenuId, registerAction2, Action2, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
21
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
22
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
23
+ import { createAndFillInContextMenuActions } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
24
+ import { LinkDetector } from './linkDetector.js';
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 linkeDetector = this.instantiationService.createInstance(LinkDetector);
53
+ this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'WatchExpressions', treeContainer, ( new WatchExpressionsDelegate()), [expressionsRenderer, this.instantiationService.createInstance(VariablesRenderer, linkeDetector)], ( new WatchExpressionsDataSource()), {
54
+ accessibilityProvider: ( new WatchExpressionsAccessibilityProvider()),
55
+ identityProvider: { getId: (element) => element.getId() },
56
+ keyboardNavigationLabelProvider: {
57
+ getKeyboardNavigationLabel: (e) => {
58
+ if (e === this.debugService.getViewModel().getSelectedExpression()?.expression) {
59
+ return undefined;
60
+ }
61
+ return e.name;
62
+ }
63
+ },
64
+ dnd: ( new WatchExpressionsDragAndDrop(this.debugService)),
65
+ overrideStyles: {
66
+ listBackground: this.getBackgroundColor()
67
+ }
68
+ });
69
+ this.tree.setInput(this.debugService);
70
+ CONTEXT_WATCH_EXPRESSIONS_FOCUSED.bindTo(this.tree.contextKeyService);
71
+ this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
72
+ this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
73
+ this._register(this.debugService.getModel().onDidChangeWatchExpressions(async (we) => {
74
+ this.watchExpressionsExist.set(this.debugService.getModel().getWatchExpressions().length > 0);
75
+ if (!this.isBodyVisible()) {
76
+ this.needsRefresh = true;
77
+ }
78
+ else {
79
+ if (we && !we.name) {
80
+ useCachedEvaluation = true;
81
+ }
82
+ await this.tree.updateChildren();
83
+ useCachedEvaluation = false;
84
+ if (we instanceof Expression) {
85
+ this.tree.reveal(we);
86
+ }
87
+ }
88
+ }));
89
+ this._register(this.debugService.getViewModel().onDidFocusStackFrame(() => {
90
+ if (!this.isBodyVisible()) {
91
+ this.needsRefresh = true;
92
+ return;
93
+ }
94
+ if (!this.watchExpressionsUpdatedScheduler.isScheduled()) {
95
+ this.watchExpressionsUpdatedScheduler.schedule();
96
+ }
97
+ }));
98
+ this._register(this.debugService.getViewModel().onWillUpdateViews(() => {
99
+ if (!ignoreViewUpdates) {
100
+ this.tree.updateChildren();
101
+ }
102
+ }));
103
+ this._register(this.onDidChangeBodyVisibility(visible => {
104
+ if (visible && this.needsRefresh) {
105
+ this.watchExpressionsUpdatedScheduler.schedule();
106
+ }
107
+ }));
108
+ let horizontalScrolling;
109
+ this._register(this.debugService.getViewModel().onDidSelectExpression(e => {
110
+ const expression = e?.expression;
111
+ if (expression instanceof Expression || (expression instanceof Variable && e?.settingWatch)) {
112
+ horizontalScrolling = this.tree.options.horizontalScrolling;
113
+ if (horizontalScrolling) {
114
+ this.tree.updateOptions({ horizontalScrolling: false });
115
+ }
116
+ if (expression.name) {
117
+ this.tree.rerender(expression);
118
+ }
119
+ }
120
+ else if (!expression && horizontalScrolling !== undefined) {
121
+ this.tree.updateOptions({ horizontalScrolling: horizontalScrolling });
122
+ horizontalScrolling = undefined;
123
+ }
124
+ }));
125
+ this._register(this.debugService.getViewModel().onDidEvaluateLazyExpression(async (e) => {
126
+ if (e instanceof Variable && this.tree.hasNode(e)) {
127
+ await this.tree.updateChildren(e, false, true);
128
+ await this.tree.expand(e);
129
+ }
130
+ }));
131
+ }
132
+ layoutBody(height, width) {
133
+ super.layoutBody(height, width);
134
+ this.tree.layout(height, width);
135
+ }
136
+ focus() {
137
+ this.tree.domFocus();
138
+ }
139
+ collapseAll() {
140
+ this.tree.collapseAll();
141
+ }
142
+ onMouseDblClick(e) {
143
+ if (e.browserEvent.target.className.indexOf('twistie') >= 0) {
144
+ return;
145
+ }
146
+ const element = e.element;
147
+ const selectedExpression = this.debugService.getViewModel().getSelectedExpression();
148
+ if (element instanceof Expression && element !== selectedExpression?.expression) {
149
+ this.debugService.getViewModel().setSelectedExpression(element, false);
150
+ }
151
+ else if (!element) {
152
+ this.debugService.addWatchExpression();
153
+ }
154
+ }
155
+ onContextMenu(e) {
156
+ const element = e.element;
157
+ const selection = this.tree.getSelection();
158
+ this.watchItemType.set(element instanceof Expression ? 'expression' : element instanceof Variable ? 'variable' : undefined);
159
+ const actions = [];
160
+ const attributes = element instanceof Variable ? element.presentationHint?.attributes : undefined;
161
+ this.variableReadonly.set(!!attributes && attributes.indexOf('readOnly') >= 0 || !!element?.presentationHint?.lazy);
162
+ createAndFillInContextMenuActions(this.menu, { arg: element, shouldForwardArgs: true }, actions);
163
+ this.contextMenuService.showContextMenu({
164
+ getAnchor: () => e.anchor,
165
+ getActions: () => actions,
166
+ getActionsContext: () => element && selection.includes(element) ? selection : element ? [element] : [],
167
+ });
168
+ }
169
+ };
170
+ WatchExpressionsView = ( __decorate([
171
+ ( __param(1, IContextMenuService)),
172
+ ( __param(2, IDebugService)),
173
+ ( __param(3, IKeybindingService)),
174
+ ( __param(4, IInstantiationService)),
175
+ ( __param(5, IViewDescriptorService)),
176
+ ( __param(6, IConfigurationService)),
177
+ ( __param(7, IContextKeyService)),
178
+ ( __param(8, IOpenerService)),
179
+ ( __param(9, IThemeService)),
180
+ ( __param(10, ITelemetryService)),
181
+ ( __param(11, IMenuService))
182
+ ], WatchExpressionsView));
183
+ class WatchExpressionsDelegate {
184
+ getHeight(_element) {
185
+ return 22;
186
+ }
187
+ getTemplateId(element) {
188
+ if (element instanceof Expression) {
189
+ return WatchExpressionsRenderer.ID;
190
+ }
191
+ return VariablesRenderer.ID;
192
+ }
193
+ }
194
+ function isDebugService(element) {
195
+ return typeof element.getConfigurationManager === 'function';
196
+ }
197
+ class WatchExpressionsDataSource {
198
+ hasChildren(element) {
199
+ return isDebugService(element) || element.hasChildren;
200
+ }
201
+ getChildren(element) {
202
+ if (isDebugService(element)) {
203
+ const debugService = element;
204
+ const watchExpressions = debugService.getModel().getWatchExpressions();
205
+ const viewModel = debugService.getViewModel();
206
+ return Promise.all(( watchExpressions.map(we => !!we.name && !useCachedEvaluation
207
+ ? we.evaluate(viewModel.focusedSession, viewModel.focusedStackFrame, 'watch').then(() => we)
208
+ : Promise.resolve(we))));
209
+ }
210
+ return element.getChildren();
211
+ }
212
+ }
213
+ let WatchExpressionsRenderer = class WatchExpressionsRenderer extends AbstractExpressionsRenderer {
214
+ static { WatchExpressionsRenderer_1 = this; }
215
+ static { this.ID = 'watchexpression'; }
216
+ constructor(menuService, contextKeyService, debugService, contextViewService) {
217
+ super(debugService, contextViewService);
218
+ this.menuService = menuService;
219
+ this.contextKeyService = contextKeyService;
220
+ }
221
+ get templateId() {
222
+ return WatchExpressionsRenderer_1.ID;
223
+ }
224
+ renderElement(node, index, data) {
225
+ super.renderExpressionElement(node.element, node, data);
226
+ }
227
+ renderExpression(expression, data, highlights) {
228
+ const text = typeof expression.value === 'string' ? `${expression.name}:` : expression.name;
229
+ let title;
230
+ if (expression.type) {
231
+ title = expression.type === expression.value ?
232
+ expression.type :
233
+ `${expression.type}: ${expression.value}`;
234
+ }
235
+ else {
236
+ title = expression.value;
237
+ }
238
+ data.label.set(text, highlights, title);
239
+ renderExpressionValue(expression, data.value, {
240
+ showChanged: true,
241
+ maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_VIEWLET,
242
+ showHover: true,
243
+ colorize: true
244
+ });
245
+ }
246
+ getInputBoxOptions(expression, settingValue) {
247
+ if (settingValue) {
248
+ return {
249
+ initialValue: expression.value,
250
+ ariaLabel: ( localize('typeNewValue', "Type new value")),
251
+ onFinish: async (value, success) => {
252
+ if (success && value) {
253
+ const focusedFrame = this.debugService.getViewModel().focusedStackFrame;
254
+ if (focusedFrame && (expression instanceof Variable || expression instanceof Expression)) {
255
+ await expression.setExpression(value, focusedFrame);
256
+ this.debugService.getViewModel().updateViews();
257
+ }
258
+ }
259
+ }
260
+ };
261
+ }
262
+ return {
263
+ initialValue: expression.name ? expression.name : '',
264
+ ariaLabel: ( localize('watchExpressionInputAriaLabel', "Type watch expression")),
265
+ placeholder: ( localize('watchExpressionPlaceholder', "Expression to watch")),
266
+ onFinish: (value, success) => {
267
+ if (success && value) {
268
+ this.debugService.renameWatchExpression(expression.getId(), value);
269
+ ignoreViewUpdates = true;
270
+ this.debugService.getViewModel().updateViews();
271
+ ignoreViewUpdates = false;
272
+ }
273
+ else if (!expression.name) {
274
+ this.debugService.removeWatchExpressions(expression.getId());
275
+ }
276
+ }
277
+ };
278
+ }
279
+ renderActionBar(actionBar, expression) {
280
+ const contextKeyService = getContextForWatchExpressionMenu(this.contextKeyService, expression);
281
+ const menu = this.menuService.createMenu(MenuId.DebugWatchContext, contextKeyService);
282
+ const primary = [];
283
+ const context = expression;
284
+ createAndFillInContextMenuActions(menu, { arg: context, shouldForwardArgs: false }, { primary, secondary: [] }, 'inline');
285
+ actionBar.clear();
286
+ actionBar.context = context;
287
+ actionBar.push(primary, { icon: true, label: false });
288
+ }
289
+ };
290
+ WatchExpressionsRenderer = WatchExpressionsRenderer_1 = ( __decorate([
291
+ ( __param(0, IMenuService)),
292
+ ( __param(1, IContextKeyService)),
293
+ ( __param(2, IDebugService)),
294
+ ( __param(3, IContextViewService))
295
+ ], WatchExpressionsRenderer));
296
+ function getContextForWatchExpressionMenu(parentContext, expression) {
297
+ return parentContext.createOverlay([
298
+ [CONTEXT_CAN_VIEW_MEMORY.key, expression.memoryReference !== undefined],
299
+ [CONTEXT_WATCH_ITEM_TYPE.key, 'expression']
300
+ ]);
301
+ }
302
+ class WatchExpressionsAccessibilityProvider {
303
+ getWidgetAriaLabel() {
304
+ return ( localize(
305
+ { comment: ['Debug is a noun in this context, not a verb.'], key: 'watchAriaTreeLabel' },
306
+ "Debug Watch Expressions"
307
+ ));
308
+ }
309
+ getAriaLabel(element) {
310
+ if (element instanceof Expression) {
311
+ return ( localize('watchExpressionAriaLabel', "{0}, value {1}", element.name, element.value));
312
+ }
313
+ return ( localize('watchVariableAriaLabel', "{0}, value {1}", element.name, element.value));
314
+ }
315
+ }
316
+ class WatchExpressionsDragAndDrop {
317
+ constructor(debugService) {
318
+ this.debugService = debugService;
319
+ }
320
+ onDragOver(data) {
321
+ if (!(data instanceof ElementsDragAndDropData)) {
322
+ return false;
323
+ }
324
+ const expressions = data.elements;
325
+ return expressions.length > 0 && expressions[0] instanceof Expression;
326
+ }
327
+ getDragURI(element) {
328
+ if (!(element instanceof Expression) || element === this.debugService.getViewModel().getSelectedExpression()?.expression) {
329
+ return null;
330
+ }
331
+ return element.getId();
332
+ }
333
+ getDragLabel(elements) {
334
+ if (elements.length === 1) {
335
+ return elements[0].name;
336
+ }
337
+ return undefined;
338
+ }
339
+ drop(data, targetElement) {
340
+ if (!(data instanceof ElementsDragAndDropData)) {
341
+ return;
342
+ }
343
+ const draggedElement = data.elements[0];
344
+ const watches = this.debugService.getModel().getWatchExpressions();
345
+ const position = targetElement instanceof Expression ? watches.indexOf(targetElement) : watches.length - 1;
346
+ this.debugService.moveWatchExpression(draggedElement.getId(), position);
347
+ }
348
+ }
349
+ registerAction2(class Collapse extends ViewAction {
350
+ constructor() {
351
+ super({
352
+ id: 'watch.collapse',
353
+ viewId: WATCH_VIEW_ID,
354
+ title: ( localize('collapse', "Collapse All")),
355
+ f1: false,
356
+ icon: Codicon.collapseAll,
357
+ precondition: CONTEXT_WATCH_EXPRESSIONS_EXIST,
358
+ menu: {
359
+ id: MenuId.ViewTitle,
360
+ order: 30,
361
+ group: 'navigation',
362
+ when: ( ContextKeyExpr.equals('view', WATCH_VIEW_ID))
363
+ }
364
+ });
365
+ }
366
+ runInView(_accessor, view) {
367
+ view.collapseAll();
368
+ }
369
+ });
370
+ const ADD_WATCH_ID = 'workbench.debug.viewlet.action.addWatchExpression';
371
+ const ADD_WATCH_LABEL = ( localize('addWatchExpression', "Add Expression"));
372
+ registerAction2(class AddWatchExpressionAction extends Action2 {
373
+ constructor() {
374
+ super({
375
+ id: ADD_WATCH_ID,
376
+ title: ADD_WATCH_LABEL,
377
+ f1: false,
378
+ icon: watchExpressionsAdd,
379
+ menu: {
380
+ id: MenuId.ViewTitle,
381
+ group: 'navigation',
382
+ when: ( ContextKeyExpr.equals('view', WATCH_VIEW_ID))
383
+ }
384
+ });
385
+ }
386
+ run(accessor) {
387
+ const debugService = accessor.get(IDebugService);
388
+ debugService.addWatchExpression();
389
+ }
390
+ });
391
+ const REMOVE_WATCH_EXPRESSIONS_COMMAND_ID = 'workbench.debug.viewlet.action.removeAllWatchExpressions';
392
+ const REMOVE_WATCH_EXPRESSIONS_LABEL = ( localize('removeAllWatchExpressions', "Remove All Expressions"));
393
+ registerAction2(class RemoveAllWatchExpressionsAction extends Action2 {
394
+ constructor() {
395
+ super({
396
+ id: REMOVE_WATCH_EXPRESSIONS_COMMAND_ID,
397
+ title: REMOVE_WATCH_EXPRESSIONS_LABEL,
398
+ f1: false,
399
+ icon: watchExpressionsRemoveAll,
400
+ precondition: CONTEXT_WATCH_EXPRESSIONS_EXIST,
401
+ menu: {
402
+ id: MenuId.ViewTitle,
403
+ order: 20,
404
+ group: 'navigation',
405
+ when: ( ContextKeyExpr.equals('view', WATCH_VIEW_ID))
406
+ }
407
+ });
408
+ }
409
+ run(accessor) {
410
+ const debugService = accessor.get(IDebugService);
411
+ debugService.removeWatchExpressions();
412
+ }
413
+ });
414
+
415
+ export { ADD_WATCH_ID, ADD_WATCH_LABEL, REMOVE_WATCH_EXPRESSIONS_COMMAND_ID, REMOVE_WATCH_EXPRESSIONS_LABEL, WatchExpressionsView };
@@ -0,0 +1,102 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
3
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
4
+ import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
5
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
6
+ import { RawContextKey, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
7
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
8
+ import { CONTEXT_DEBUGGERS_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 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
12
+ import { Extensions, ViewContentGroups, IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
13
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
14
+ import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
15
+ import { isCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
16
+ import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
17
+ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
18
+ import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
19
+ import { DEBUG_START_COMMAND_ID, SELECT_AND_START_ID } from './debugCommands.js';
20
+
21
+ const debugStartLanguageKey = 'debugStartLanguage';
22
+ const CONTEXT_DEBUG_START_LANGUAGE = ( (new RawContextKey(debugStartLanguageKey, undefined)));
23
+ const CONTEXT_DEBUGGER_INTERESTED_IN_ACTIVE_EDITOR = ( (new RawContextKey('debuggerInterestedInActiveEditor', false)));
24
+ let WelcomeView = class WelcomeView extends ViewPane {
25
+ static { this.ID = 'workbench.debug.welcome'; }
26
+ static { this.LABEL = ( (localize('run', "Run"))); }
27
+ constructor(options, themeService, keybindingService, contextMenuService, configurationService, contextKeyService, debugService, editorService, instantiationService, viewDescriptorService, openerService, storageSevice, telemetryService) {
28
+ super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
29
+ this.debugService = debugService;
30
+ this.editorService = editorService;
31
+ this.debugStartLanguageContext = CONTEXT_DEBUG_START_LANGUAGE.bindTo(contextKeyService);
32
+ this.debuggerInterestedContext = CONTEXT_DEBUGGER_INTERESTED_IN_ACTIVE_EDITOR.bindTo(contextKeyService);
33
+ const lastSetLanguage = storageSevice.get(debugStartLanguageKey, 1 );
34
+ this.debugStartLanguageContext.set(lastSetLanguage);
35
+ const setContextKey = () => {
36
+ const editorControl = this.editorService.activeTextEditorControl;
37
+ if (isCodeEditor(editorControl)) {
38
+ const model = editorControl.getModel();
39
+ const language = model ? model.getLanguageId() : undefined;
40
+ if (language && this.debugService.getAdapterManager().someDebuggerInterestedInLanguage(language)) {
41
+ this.debugStartLanguageContext.set(language);
42
+ this.debuggerInterestedContext.set(true);
43
+ storageSevice.store(debugStartLanguageKey, language, 1 , 1 );
44
+ return;
45
+ }
46
+ }
47
+ this.debuggerInterestedContext.set(false);
48
+ };
49
+ const disposables = ( (new DisposableStore()));
50
+ this._register(disposables);
51
+ this._register(editorService.onDidActiveEditorChange(() => {
52
+ disposables.clear();
53
+ const editorControl = this.editorService.activeTextEditorControl;
54
+ if (isCodeEditor(editorControl)) {
55
+ disposables.add(editorControl.onDidChangeModelLanguage(setContextKey));
56
+ }
57
+ setContextKey();
58
+ }));
59
+ this._register(this.debugService.getAdapterManager().onDidRegisterDebugger(setContextKey));
60
+ this._register(this.onDidChangeBodyVisibility(visible => {
61
+ if (visible) {
62
+ setContextKey();
63
+ }
64
+ }));
65
+ setContextKey();
66
+ const debugKeybinding = this.keybindingService.lookupKeybinding(DEBUG_START_COMMAND_ID);
67
+ debugKeybindingLabel = debugKeybinding ? ` (${debugKeybinding.getLabel()})` : '';
68
+ }
69
+ shouldShowWelcome() {
70
+ return true;
71
+ }
72
+ };
73
+ WelcomeView = ( (__decorate([
74
+ ( (__param(1, IThemeService))),
75
+ ( (__param(2, IKeybindingService))),
76
+ ( (__param(3, IContextMenuService))),
77
+ ( (__param(4, IConfigurationService))),
78
+ ( (__param(5, IContextKeyService))),
79
+ ( (__param(6, IDebugService))),
80
+ ( (__param(7, IEditorService))),
81
+ ( (__param(8, IInstantiationService))),
82
+ ( (__param(9, IViewDescriptorService))),
83
+ ( (__param(10, IOpenerService))),
84
+ ( (__param(11, IStorageService))),
85
+ ( (__param(12, ITelemetryService)))
86
+ ], WelcomeView)));
87
+ const viewsRegistry = ( (Registry.as(Extensions.ViewsRegistry)));
88
+ let debugKeybindingLabel = '';
89
+ ( (viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
90
+ content: `[${( ( localize('runAndDebugAction', "Run and Debug")))}${debugKeybindingLabel}](command:${DEBUG_START_COMMAND_ID})`,
91
+ when: CONTEXT_DEBUGGERS_AVAILABLE,
92
+ group: ViewContentGroups.Debug,
93
+ order: 1
94
+ })));
95
+ ( (viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
96
+ content: `[${( ( localize('detectThenRunAndDebug', "Show all automatic debug configurations")))}](command:${SELECT_AND_START_ID}).`,
97
+ when: CONTEXT_DEBUGGERS_AVAILABLE,
98
+ group: ViewContentGroups.Debug,
99
+ order: 10
100
+ })));
101
+
102
+ export { WelcomeView };
@@ -0,0 +1,21 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
3
+
4
+ let Breakpoints = class Breakpoints {
5
+ constructor(breakpointContribution, contextKeyService) {
6
+ this.breakpointContribution = breakpointContribution;
7
+ this.contextKeyService = contextKeyService;
8
+ this.breakpointsWhen = typeof breakpointContribution.when === 'string' ? ContextKeyExpr.deserialize(breakpointContribution.when) : undefined;
9
+ }
10
+ get language() {
11
+ return this.breakpointContribution.language;
12
+ }
13
+ get enabled() {
14
+ return !this.breakpointsWhen || this.contextKeyService.contextMatchesRules(this.breakpointsWhen);
15
+ }
16
+ };
17
+ Breakpoints = ( __decorate([
18
+ ( __param(1, IContextKeyService))
19
+ ], Breakpoints));
20
+
21
+ export { Breakpoints };
@@ -0,0 +1,17 @@
1
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
2
+
3
+ class DebugCompoundRoot {
4
+ constructor() {
5
+ this.stopped = false;
6
+ this.stopEmitter = ( new Emitter());
7
+ this.onDidSessionStop = this.stopEmitter.event;
8
+ }
9
+ sessionStopped() {
10
+ if (!this.stopped) {
11
+ this.stopped = true;
12
+ this.stopEmitter.fire();
13
+ }
14
+ }
15
+ }
16
+
17
+ export { DebugCompoundRoot };
@@ -0,0 +1,100 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
3
+ import { getMimeTypes } from 'monaco-editor/esm/vs/editor/common/services/languagesAssociations.js';
4
+ import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
5
+ import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
6
+ import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
7
+ import { DEBUG_SCHEME, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
8
+ import { Source } from './debugSource.js';
9
+ import { IEditorWorkerService } from 'monaco-editor/esm/vs/editor/common/services/editorWorker.js';
10
+ import { EditOperation } from 'monaco-editor/esm/vs/editor/common/core/editOperation.js';
11
+ import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
12
+ import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
13
+ import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
14
+ import { ErrorNoTelemetry } from 'monaco-editor/esm/vs/base/common/errors.js';
15
+
16
+ var DebugContentProvider_1;
17
+ let DebugContentProvider = class DebugContentProvider {
18
+ static { DebugContentProvider_1 = this; }
19
+ constructor(textModelResolverService, debugService, modelService, languageService, editorWorkerService) {
20
+ this.debugService = debugService;
21
+ this.modelService = modelService;
22
+ this.languageService = languageService;
23
+ this.editorWorkerService = editorWorkerService;
24
+ this.pendingUpdates = ( new Map());
25
+ textModelResolverService.registerTextModelContentProvider(DEBUG_SCHEME, this);
26
+ DebugContentProvider_1.INSTANCE = this;
27
+ }
28
+ dispose() {
29
+ this.pendingUpdates.forEach(cancellationSource => cancellationSource.dispose());
30
+ }
31
+ provideTextContent(resource) {
32
+ return this.createOrUpdateContentModel(resource, true);
33
+ }
34
+ static refreshDebugContent(resource) {
35
+ DebugContentProvider_1.INSTANCE?.createOrUpdateContentModel(resource, false);
36
+ }
37
+ createOrUpdateContentModel(resource, createIfNotExists) {
38
+ const model = this.modelService.getModel(resource);
39
+ if (!model && !createIfNotExists) {
40
+ return null;
41
+ }
42
+ let session;
43
+ if (resource.query) {
44
+ const data = Source.getEncodedDebugData(resource);
45
+ session = this.debugService.getModel().getSession(data.sessionId);
46
+ }
47
+ if (!session) {
48
+ session = this.debugService.getViewModel().focusedSession;
49
+ }
50
+ if (!session) {
51
+ return Promise.reject(( new ErrorNoTelemetry(( localize('unable', "Unable to resolve the resource without a debug session")))));
52
+ }
53
+ const createErrModel = (errMsg) => {
54
+ this.debugService.sourceIsNotAvailable(resource);
55
+ const languageSelection = this.languageService.createById(PLAINTEXT_LANGUAGE_ID);
56
+ const message = errMsg
57
+ ? ( localize(
58
+ 'canNotResolveSourceWithError',
59
+ "Could not load source '{0}': {1}.",
60
+ resource.path,
61
+ errMsg
62
+ ))
63
+ : ( localize('canNotResolveSource', "Could not load source '{0}'.", resource.path));
64
+ return this.modelService.createModel(message, languageSelection, resource);
65
+ };
66
+ return session.loadSource(resource).then(response => {
67
+ if (response && response.body) {
68
+ if (model) {
69
+ const newContent = response.body.content;
70
+ const cancellationSource = this.pendingUpdates.get(model.id);
71
+ cancellationSource?.cancel();
72
+ const myToken = ( new CancellationTokenSource());
73
+ this.pendingUpdates.set(model.id, myToken);
74
+ return this.editorWorkerService.computeMoreMinimalEdits(model.uri, [{ text: newContent, range: model.getFullModelRange() }]).then(edits => {
75
+ this.pendingUpdates.delete(model.id);
76
+ if (!myToken.token.isCancellationRequested && edits && edits.length > 0) {
77
+ model.applyEdits(( edits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text))));
78
+ }
79
+ return model;
80
+ });
81
+ }
82
+ else {
83
+ const mime = response.body.mimeType || getMimeTypes(resource)[0];
84
+ const languageSelection = this.languageService.createByMimeType(mime);
85
+ return this.modelService.createModel(response.body.content, languageSelection, resource);
86
+ }
87
+ }
88
+ return createErrModel();
89
+ }, (err) => createErrModel(err.message));
90
+ }
91
+ };
92
+ DebugContentProvider = DebugContentProvider_1 = ( __decorate([
93
+ ( __param(0, ITextModelService)),
94
+ ( __param(1, IDebugService)),
95
+ ( __param(2, IModelService)),
96
+ ( __param(3, ILanguageService)),
97
+ ( __param(4, IEditorWorkerService))
98
+ ], DebugContentProvider));
99
+
100
+ export { DebugContentProvider };