@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,347 @@
1
+ import { RGBA, Color } from 'monaco-editor/esm/vs/base/common/color.js';
2
+ import { ansiColorIdentifiers } from 'vscode/vscode/vs/workbench/contrib/terminal/common/terminalColorRegistry';
3
+
4
+ function handleANSIOutput(text, linkDetector, themeService, workspaceFolder) {
5
+ const root = document.createElement('span');
6
+ const textLength = text.length;
7
+ let styleNames = [];
8
+ let customFgColor;
9
+ let customBgColor;
10
+ let customUnderlineColor;
11
+ let colorsInverted = false;
12
+ let currentPos = 0;
13
+ let buffer = '';
14
+ while (currentPos < textLength) {
15
+ let sequenceFound = false;
16
+ if (text.charCodeAt(currentPos) === 27 && text.charAt(currentPos + 1) === '[') {
17
+ const startPos = currentPos;
18
+ currentPos += 2;
19
+ let ansiSequence = '';
20
+ while (currentPos < textLength) {
21
+ const char = text.charAt(currentPos);
22
+ ansiSequence += char;
23
+ currentPos++;
24
+ if (char.match(/^[ABCDHIJKfhmpsu]$/)) {
25
+ sequenceFound = true;
26
+ break;
27
+ }
28
+ }
29
+ if (sequenceFound) {
30
+ appendStylizedStringToContainer(root, buffer, styleNames, linkDetector, workspaceFolder, customFgColor, customBgColor, customUnderlineColor);
31
+ buffer = '';
32
+ if (ansiSequence.match(/^(?:[34][0-8]|9[0-7]|10[0-7]|[0-9]|2[1-5,7-9]|[34]9|5[8,9]|1[0-9])(?:;[349][0-7]|10[0-7]|[013]|[245]|[34]9)?(?:;[012]?[0-9]?[0-9])*;?m$/)) {
33
+ const styleCodes = ( ansiSequence.slice(0, -1)
34
+ .split(';')
35
+ .filter(elem => elem !== '')
36
+ .map(elem => parseInt(elem, 10)));
37
+ if (styleCodes[0] === 38 || styleCodes[0] === 48 || styleCodes[0] === 58) {
38
+ const colorType = (styleCodes[0] === 38) ? 'foreground' : ((styleCodes[0] === 48) ? 'background' : 'underline');
39
+ if (styleCodes[1] === 5) {
40
+ set8BitColor(styleCodes, colorType);
41
+ }
42
+ else if (styleCodes[1] === 2) {
43
+ set24BitColor(styleCodes, colorType);
44
+ }
45
+ }
46
+ else {
47
+ setBasicFormatters(styleCodes);
48
+ }
49
+ }
50
+ }
51
+ else {
52
+ currentPos = startPos;
53
+ }
54
+ }
55
+ if (sequenceFound === false) {
56
+ buffer += text.charAt(currentPos);
57
+ currentPos++;
58
+ }
59
+ }
60
+ if (buffer) {
61
+ appendStylizedStringToContainer(root, buffer, styleNames, linkDetector, workspaceFolder, customFgColor, customBgColor, customUnderlineColor);
62
+ }
63
+ return root;
64
+ function changeColor(colorType, color) {
65
+ if (colorType === 'foreground') {
66
+ customFgColor = color;
67
+ }
68
+ else if (colorType === 'background') {
69
+ customBgColor = color;
70
+ }
71
+ else if (colorType === 'underline') {
72
+ customUnderlineColor = color;
73
+ }
74
+ styleNames = styleNames.filter(style => style !== `code-${colorType}-colored`);
75
+ if (color !== undefined) {
76
+ styleNames.push(`code-${colorType}-colored`);
77
+ }
78
+ }
79
+ function reverseForegroundAndBackgroundColors() {
80
+ const oldFgColor = customFgColor;
81
+ changeColor('foreground', customBgColor);
82
+ changeColor('background', oldFgColor);
83
+ }
84
+ function setBasicFormatters(styleCodes) {
85
+ for (const code of styleCodes) {
86
+ switch (code) {
87
+ case 0: {
88
+ styleNames = [];
89
+ customFgColor = undefined;
90
+ customBgColor = undefined;
91
+ break;
92
+ }
93
+ case 1: {
94
+ styleNames = styleNames.filter(style => style !== `code-bold`);
95
+ styleNames.push('code-bold');
96
+ break;
97
+ }
98
+ case 2: {
99
+ styleNames = styleNames.filter(style => style !== `code-dim`);
100
+ styleNames.push('code-dim');
101
+ break;
102
+ }
103
+ case 3: {
104
+ styleNames = styleNames.filter(style => style !== `code-italic`);
105
+ styleNames.push('code-italic');
106
+ break;
107
+ }
108
+ case 4: {
109
+ styleNames = styleNames.filter(style => (style !== `code-underline` && style !== `code-double-underline`));
110
+ styleNames.push('code-underline');
111
+ break;
112
+ }
113
+ case 5: {
114
+ styleNames = styleNames.filter(style => style !== `code-blink`);
115
+ styleNames.push('code-blink');
116
+ break;
117
+ }
118
+ case 6: {
119
+ styleNames = styleNames.filter(style => style !== `code-rapid-blink`);
120
+ styleNames.push('code-rapid-blink');
121
+ break;
122
+ }
123
+ case 7: {
124
+ if (!colorsInverted) {
125
+ colorsInverted = true;
126
+ reverseForegroundAndBackgroundColors();
127
+ }
128
+ break;
129
+ }
130
+ case 8: {
131
+ styleNames = styleNames.filter(style => style !== `code-hidden`);
132
+ styleNames.push('code-hidden');
133
+ break;
134
+ }
135
+ case 9: {
136
+ styleNames = styleNames.filter(style => style !== `code-strike-through`);
137
+ styleNames.push('code-strike-through');
138
+ break;
139
+ }
140
+ case 10: {
141
+ styleNames = styleNames.filter(style => !style.startsWith('code-font'));
142
+ break;
143
+ }
144
+ case 11:
145
+ case 12:
146
+ case 13:
147
+ case 14:
148
+ case 15:
149
+ case 16:
150
+ case 17:
151
+ case 18:
152
+ case 19:
153
+ case 20: {
154
+ styleNames = styleNames.filter(style => !style.startsWith('code-font'));
155
+ styleNames.push(`code-font-${code - 10}`);
156
+ break;
157
+ }
158
+ case 21: {
159
+ styleNames = styleNames.filter(style => (style !== `code-underline` && style !== `code-double-underline`));
160
+ styleNames.push('code-double-underline');
161
+ break;
162
+ }
163
+ case 22: {
164
+ styleNames = styleNames.filter(style => (style !== `code-bold` && style !== `code-dim`));
165
+ break;
166
+ }
167
+ case 23: {
168
+ styleNames = styleNames.filter(style => (style !== `code-italic` && style !== `code-font-10`));
169
+ break;
170
+ }
171
+ case 24: {
172
+ styleNames = styleNames.filter(style => (style !== `code-underline` && style !== `code-double-underline`));
173
+ break;
174
+ }
175
+ case 25: {
176
+ styleNames = styleNames.filter(style => (style !== `code-blink` && style !== `code-rapid-blink`));
177
+ break;
178
+ }
179
+ case 27: {
180
+ if (colorsInverted) {
181
+ colorsInverted = false;
182
+ reverseForegroundAndBackgroundColors();
183
+ }
184
+ break;
185
+ }
186
+ case 28: {
187
+ styleNames = styleNames.filter(style => style !== `code-hidden`);
188
+ break;
189
+ }
190
+ case 29: {
191
+ styleNames = styleNames.filter(style => style !== `code-strike-through`);
192
+ break;
193
+ }
194
+ case 53: {
195
+ styleNames = styleNames.filter(style => style !== `code-overline`);
196
+ styleNames.push('code-overline');
197
+ break;
198
+ }
199
+ case 55: {
200
+ styleNames = styleNames.filter(style => style !== `code-overline`);
201
+ break;
202
+ }
203
+ case 39: {
204
+ changeColor('foreground', undefined);
205
+ break;
206
+ }
207
+ case 49: {
208
+ changeColor('background', undefined);
209
+ break;
210
+ }
211
+ case 59: {
212
+ changeColor('underline', undefined);
213
+ break;
214
+ }
215
+ case 73: {
216
+ styleNames = styleNames.filter(style => (style !== `code-superscript` && style !== `code-subscript`));
217
+ styleNames.push('code-superscript');
218
+ break;
219
+ }
220
+ case 74: {
221
+ styleNames = styleNames.filter(style => (style !== `code-superscript` && style !== `code-subscript`));
222
+ styleNames.push('code-subscript');
223
+ break;
224
+ }
225
+ case 75: {
226
+ styleNames = styleNames.filter(style => (style !== `code-superscript` && style !== `code-subscript`));
227
+ break;
228
+ }
229
+ default: {
230
+ setBasicColor(code);
231
+ break;
232
+ }
233
+ }
234
+ }
235
+ }
236
+ function set24BitColor(styleCodes, colorType) {
237
+ if (styleCodes.length >= 5 &&
238
+ styleCodes[2] >= 0 && styleCodes[2] <= 255 &&
239
+ styleCodes[3] >= 0 && styleCodes[3] <= 255 &&
240
+ styleCodes[4] >= 0 && styleCodes[4] <= 255) {
241
+ const customColor = ( new RGBA(styleCodes[2], styleCodes[3], styleCodes[4]));
242
+ changeColor(colorType, customColor);
243
+ }
244
+ }
245
+ function set8BitColor(styleCodes, colorType) {
246
+ let colorNumber = styleCodes[2];
247
+ const color = calcANSI8bitColor(colorNumber);
248
+ if (color) {
249
+ changeColor(colorType, color);
250
+ }
251
+ else if (colorNumber >= 0 && colorNumber <= 15) {
252
+ if (colorType === 'underline') {
253
+ const theme = themeService.getColorTheme();
254
+ const colorName = ansiColorIdentifiers[colorNumber];
255
+ const color = theme.getColor(colorName);
256
+ if (color) {
257
+ changeColor(colorType, color.rgba);
258
+ }
259
+ return;
260
+ }
261
+ colorNumber += 30;
262
+ if (colorNumber >= 38) {
263
+ colorNumber += 52;
264
+ }
265
+ if (colorType === 'background') {
266
+ colorNumber += 10;
267
+ }
268
+ setBasicColor(colorNumber);
269
+ }
270
+ }
271
+ function setBasicColor(styleCode) {
272
+ const theme = themeService.getColorTheme();
273
+ let colorType;
274
+ let colorIndex;
275
+ if (styleCode >= 30 && styleCode <= 37) {
276
+ colorIndex = styleCode - 30;
277
+ colorType = 'foreground';
278
+ }
279
+ else if (styleCode >= 90 && styleCode <= 97) {
280
+ colorIndex = (styleCode - 90) + 8;
281
+ colorType = 'foreground';
282
+ }
283
+ else if (styleCode >= 40 && styleCode <= 47) {
284
+ colorIndex = styleCode - 40;
285
+ colorType = 'background';
286
+ }
287
+ else if (styleCode >= 100 && styleCode <= 107) {
288
+ colorIndex = (styleCode - 100) + 8;
289
+ colorType = 'background';
290
+ }
291
+ if (colorIndex !== undefined && colorType) {
292
+ const colorName = ansiColorIdentifiers[colorIndex];
293
+ const color = theme.getColor(colorName);
294
+ if (color) {
295
+ changeColor(colorType, color.rgba);
296
+ }
297
+ }
298
+ }
299
+ }
300
+ function appendStylizedStringToContainer(root, stringContent, cssClasses, linkDetector, workspaceFolder, customTextColor, customBackgroundColor, customUnderlineColor) {
301
+ if (!root || !stringContent) {
302
+ return;
303
+ }
304
+ const container = linkDetector.linkify(stringContent, true, workspaceFolder);
305
+ container.className = cssClasses.join(' ');
306
+ if (customTextColor) {
307
+ container.style.color =
308
+ Color.Format.CSS.formatRGB(( new Color(customTextColor)));
309
+ }
310
+ if (customBackgroundColor) {
311
+ container.style.backgroundColor =
312
+ Color.Format.CSS.formatRGB(( new Color(customBackgroundColor)));
313
+ }
314
+ if (customUnderlineColor) {
315
+ container.style.textDecorationColor =
316
+ Color.Format.CSS.formatRGB(( new Color(customUnderlineColor)));
317
+ }
318
+ root.appendChild(container);
319
+ }
320
+ function calcANSI8bitColor(colorNumber) {
321
+ if (colorNumber % 1 !== 0) {
322
+ return;
323
+ }
324
+ if (colorNumber >= 16 && colorNumber <= 231) {
325
+ colorNumber -= 16;
326
+ let blue = colorNumber % 6;
327
+ colorNumber = (colorNumber - blue) / 6;
328
+ let green = colorNumber % 6;
329
+ colorNumber = (colorNumber - green) / 6;
330
+ let red = colorNumber;
331
+ const convFactor = 255 / 5;
332
+ blue = Math.round(blue * convFactor);
333
+ green = Math.round(green * convFactor);
334
+ red = Math.round(red * convFactor);
335
+ return ( new RGBA(red, green, blue));
336
+ }
337
+ else if (colorNumber >= 232 && colorNumber <= 255) {
338
+ colorNumber -= 232;
339
+ const colorLevel = Math.round(colorNumber / 23 * 255);
340
+ return ( new RGBA(colorLevel, colorLevel, colorLevel));
341
+ }
342
+ else {
343
+ return;
344
+ }
345
+ }
346
+
347
+ export { appendStylizedStringToContainer, calcANSI8bitColor, handleANSIOutput };
@@ -0,0 +1,299 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
3
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
4
+ import { StandardKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/keyboardEvent.js';
5
+ import { SelectBox } from 'monaco-editor/esm/vs/base/browser/ui/selectBox/selectBox.js';
6
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
7
+ import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
8
+ import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
9
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
10
+ import { asCssVariable, selectBorder, selectBackground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
11
+ import { IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
12
+ import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
13
+ import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
14
+ import { ADD_CONFIGURATION_ID } from './debugCommands.js';
15
+ import { BaseActionViewItem, SelectActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js';
16
+ import { debugStart } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
17
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
18
+ import { defaultSelectBoxStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
19
+
20
+ var StartDebugActionViewItem_1;
21
+ const $ = dom.$;
22
+ let StartDebugActionViewItem = class StartDebugActionViewItem extends BaseActionViewItem {
23
+ static { StartDebugActionViewItem_1 = this; }
24
+ static { this.SEPARATOR = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500'; }
25
+ constructor(context, action, debugService, configurationService, commandService, contextService, contextViewService, keybindingService) {
26
+ super(context, action);
27
+ this.context = context;
28
+ this.debugService = debugService;
29
+ this.configurationService = configurationService;
30
+ this.commandService = commandService;
31
+ this.contextService = contextService;
32
+ this.keybindingService = keybindingService;
33
+ this.debugOptions = [];
34
+ this.selected = 0;
35
+ this.providers = [];
36
+ this.toDispose = [];
37
+ this.selectBox = ( new SelectBox(
38
+ [],
39
+ -1,
40
+ contextViewService,
41
+ defaultSelectBoxStyles,
42
+ { ariaLabel: ( nls.localize('debugLaunchConfigurations', 'Debug Launch Configurations')) }
43
+ ));
44
+ this.selectBox.setFocusable(false);
45
+ this.toDispose.push(this.selectBox);
46
+ this.registerListeners();
47
+ }
48
+ registerListeners() {
49
+ this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
50
+ if (e.affectsConfiguration('launch')) {
51
+ this.updateOptions();
52
+ }
53
+ }));
54
+ this.toDispose.push(this.debugService.getConfigurationManager().onDidSelectConfiguration(() => {
55
+ this.updateOptions();
56
+ }));
57
+ }
58
+ render(container) {
59
+ this.container = container;
60
+ container.classList.add('start-debug-action-item');
61
+ this.start = dom.append(container, $(ThemeIcon.asCSSSelector(debugStart)));
62
+ const keybinding = this.keybindingService.lookupKeybinding(this.action.id)?.getLabel();
63
+ const keybindingLabel = keybinding ? ` (${keybinding})` : '';
64
+ this.start.title = this.action.label + keybindingLabel;
65
+ this.start.setAttribute('role', 'button');
66
+ this.start.ariaLabel = this.start.title;
67
+ this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.CLICK, () => {
68
+ this.start.blur();
69
+ if (this.debugService.state !== 1 ) {
70
+ this.actionRunner.run(this.action, this.context);
71
+ }
72
+ }));
73
+ this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_DOWN, (e) => {
74
+ if (this.action.enabled && e.button === 0) {
75
+ this.start.classList.add('active');
76
+ }
77
+ }));
78
+ this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_UP, () => {
79
+ this.start.classList.remove('active');
80
+ }));
81
+ this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_OUT, () => {
82
+ this.start.classList.remove('active');
83
+ }));
84
+ this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.KEY_DOWN, (e) => {
85
+ const event = ( new StandardKeyboardEvent(e));
86
+ if (event.equals(17 )) {
87
+ this.start.tabIndex = -1;
88
+ this.selectBox.focus();
89
+ event.stopPropagation();
90
+ }
91
+ }));
92
+ this.toDispose.push(this.selectBox.onDidSelect(async (e) => {
93
+ const target = this.debugOptions[e.index];
94
+ const shouldBeSelected = target.handler ? await target.handler() : false;
95
+ if (shouldBeSelected) {
96
+ this.selected = e.index;
97
+ }
98
+ else {
99
+ this.selectBox.select(this.selected);
100
+ }
101
+ }));
102
+ const selectBoxContainer = $('.configuration');
103
+ this.selectBox.render(dom.append(container, selectBoxContainer));
104
+ this.toDispose.push(dom.addDisposableListener(selectBoxContainer, dom.EventType.KEY_DOWN, (e) => {
105
+ const event = ( new StandardKeyboardEvent(e));
106
+ if (event.equals(15 )) {
107
+ this.selectBox.setFocusable(false);
108
+ this.start.tabIndex = 0;
109
+ this.start.focus();
110
+ event.stopPropagation();
111
+ }
112
+ }));
113
+ this.container.style.border = `1px solid ${asCssVariable(selectBorder)}`;
114
+ selectBoxContainer.style.borderLeft = `1px solid ${asCssVariable(selectBorder)}`;
115
+ this.container.style.backgroundColor = asCssVariable(selectBackground);
116
+ this.debugService.getConfigurationManager().getDynamicProviders().then(providers => {
117
+ this.providers = providers;
118
+ if (this.providers.length > 0) {
119
+ this.updateOptions();
120
+ }
121
+ });
122
+ this.updateOptions();
123
+ }
124
+ setActionContext(context) {
125
+ this.context = context;
126
+ }
127
+ isEnabled() {
128
+ return true;
129
+ }
130
+ focus(fromRight) {
131
+ if (fromRight) {
132
+ this.selectBox.focus();
133
+ }
134
+ else {
135
+ this.start.tabIndex = 0;
136
+ this.start.focus();
137
+ }
138
+ }
139
+ blur() {
140
+ this.start.tabIndex = -1;
141
+ this.selectBox.blur();
142
+ this.container.blur();
143
+ }
144
+ setFocusable(focusable) {
145
+ if (focusable) {
146
+ this.start.tabIndex = 0;
147
+ }
148
+ else {
149
+ this.start.tabIndex = -1;
150
+ this.selectBox.setFocusable(false);
151
+ }
152
+ }
153
+ dispose() {
154
+ this.toDispose = dispose(this.toDispose);
155
+ }
156
+ updateOptions() {
157
+ this.selected = 0;
158
+ this.debugOptions = [];
159
+ const manager = this.debugService.getConfigurationManager();
160
+ const inWorkspace = this.contextService.getWorkbenchState() === 3 ;
161
+ let lastGroup;
162
+ const disabledIdxs = [];
163
+ manager.getAllConfigurations().forEach(({ launch, name, presentation }) => {
164
+ if (lastGroup !== presentation?.group) {
165
+ lastGroup = presentation?.group;
166
+ if (this.debugOptions.length) {
167
+ this.debugOptions.push({ label: StartDebugActionViewItem_1.SEPARATOR, handler: () => Promise.resolve(false) });
168
+ disabledIdxs.push(this.debugOptions.length - 1);
169
+ }
170
+ }
171
+ if (name === manager.selectedConfiguration.name && launch === manager.selectedConfiguration.launch) {
172
+ this.selected = this.debugOptions.length;
173
+ }
174
+ const label = inWorkspace ? `${name} (${launch.name})` : name;
175
+ this.debugOptions.push({
176
+ label, handler: async () => {
177
+ await manager.selectConfiguration(launch, name);
178
+ return true;
179
+ }
180
+ });
181
+ });
182
+ manager.getRecentDynamicConfigurations().slice(0, 3).forEach(({ name, type }) => {
183
+ if (type === manager.selectedConfiguration.type && manager.selectedConfiguration.name === name) {
184
+ this.selected = this.debugOptions.length;
185
+ }
186
+ this.debugOptions.push({
187
+ label: name,
188
+ handler: async () => {
189
+ await manager.selectConfiguration(undefined, name, undefined, { type });
190
+ return true;
191
+ }
192
+ });
193
+ });
194
+ if (this.debugOptions.length === 0) {
195
+ this.debugOptions.push({ label: ( nls.localize('noConfigurations', "No Configurations")), handler: async () => false });
196
+ }
197
+ this.debugOptions.push({ label: StartDebugActionViewItem_1.SEPARATOR, handler: () => Promise.resolve(false) });
198
+ disabledIdxs.push(this.debugOptions.length - 1);
199
+ this.providers.forEach(p => {
200
+ this.debugOptions.push({
201
+ label: `${p.label}...`,
202
+ handler: async () => {
203
+ const picked = await p.pick();
204
+ if (picked) {
205
+ await manager.selectConfiguration(picked.launch, picked.config.name, picked.config, { type: p.type });
206
+ return true;
207
+ }
208
+ return false;
209
+ }
210
+ });
211
+ });
212
+ manager.getLaunches().filter(l => !l.hidden).forEach(l => {
213
+ const label = inWorkspace ? ( nls.localize("addConfigTo", "Add Config ({0})...", l.name)) : ( nls.localize('addConfiguration', "Add Configuration..."));
214
+ this.debugOptions.push({
215
+ label, handler: async () => {
216
+ await this.commandService.executeCommand(ADD_CONFIGURATION_ID, ( l.uri.toString()));
217
+ return false;
218
+ }
219
+ });
220
+ });
221
+ this.selectBox.setOptions(( this.debugOptions.map(
222
+ (data, index) => ({ text: data.label, isDisabled: disabledIdxs.indexOf(index) !== -1 })
223
+ )), this.selected);
224
+ }
225
+ };
226
+ StartDebugActionViewItem = StartDebugActionViewItem_1 = ( __decorate([
227
+ ( __param(2, IDebugService)),
228
+ ( __param(3, IConfigurationService)),
229
+ ( __param(4, ICommandService)),
230
+ ( __param(5, IWorkspaceContextService)),
231
+ ( __param(6, IContextViewService)),
232
+ ( __param(7, IKeybindingService))
233
+ ], StartDebugActionViewItem));
234
+ let FocusSessionActionViewItem = class FocusSessionActionViewItem extends SelectActionViewItem {
235
+ constructor(action, session, debugService, contextViewService, configurationService) {
236
+ super(null, action, [], -1, contextViewService, defaultSelectBoxStyles, { ariaLabel: ( nls.localize('debugSession', 'Debug Session')) });
237
+ this.debugService = debugService;
238
+ this.configurationService = configurationService;
239
+ this._register(this.debugService.getViewModel().onDidFocusSession(() => {
240
+ const session = this.getSelectedSession();
241
+ if (session) {
242
+ const index = this.getSessions().indexOf(session);
243
+ this.select(index);
244
+ }
245
+ }));
246
+ this._register(this.debugService.onDidNewSession(session => {
247
+ const sessionListeners = [];
248
+ sessionListeners.push(session.onDidChangeName(() => this.update()));
249
+ sessionListeners.push(session.onDidEndAdapter(() => dispose(sessionListeners)));
250
+ this.update();
251
+ }));
252
+ this.getSessions().forEach(session => {
253
+ this._register(session.onDidChangeName(() => this.update()));
254
+ });
255
+ this._register(this.debugService.onDidEndSession(() => this.update()));
256
+ const selectedSession = session ? this.mapFocusedSessionToSelected(session) : undefined;
257
+ this.update(selectedSession);
258
+ }
259
+ getActionContext(_, index) {
260
+ return this.getSessions()[index];
261
+ }
262
+ update(session) {
263
+ if (!session) {
264
+ session = this.getSelectedSession();
265
+ }
266
+ const sessions = this.getSessions();
267
+ const names = ( sessions.map(s => {
268
+ const label = s.getLabel();
269
+ if (s.parentSession) {
270
+ return `\u00A0\u00A0${label}`;
271
+ }
272
+ return label;
273
+ }));
274
+ this.setOptions(( names.map(data => ({ text: data }))), session ? sessions.indexOf(session) : undefined);
275
+ }
276
+ getSelectedSession() {
277
+ const session = this.debugService.getViewModel().focusedSession;
278
+ return session ? this.mapFocusedSessionToSelected(session) : undefined;
279
+ }
280
+ getSessions() {
281
+ const showSubSessions = this.configurationService.getValue('debug').showSubSessionsInToolBar;
282
+ const sessions = this.debugService.getModel().getSessions();
283
+ return showSubSessions ? sessions : sessions.filter(s => !s.parentSession);
284
+ }
285
+ mapFocusedSessionToSelected(focusedSession) {
286
+ const showSubSessions = this.configurationService.getValue('debug').showSubSessionsInToolBar;
287
+ while (focusedSession.parentSession && !showSubSessions) {
288
+ focusedSession = focusedSession.parentSession;
289
+ }
290
+ return focusedSession;
291
+ }
292
+ };
293
+ FocusSessionActionViewItem = ( __decorate([
294
+ ( __param(2, IDebugService)),
295
+ ( __param(3, IContextViewService)),
296
+ ( __param(4, IConfigurationService))
297
+ ], FocusSessionActionViewItem));
298
+
299
+ export { FocusSessionActionViewItem, StartDebugActionViewItem };