@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,347 +0,0 @@
1
- import { RGBA, Color } from 'vscode/vscode/vs/base/common/color';
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 };
@@ -1,324 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { append, addDisposableListener, EventType, $ as $$1 } from 'vscode/vscode/vs/base/browser/dom';
4
- import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
5
- import { SelectBox } from 'vscode/vscode/vs/base/browser/ui/selectBox/selectBox';
6
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
7
- import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
8
- import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
9
- import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
10
- import { asCssVariable, selectBorder, selectBackground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
11
- import { IContextViewService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
12
- import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
13
- import { dispose } from 'vscode/vscode/vs/base/common/lifecycle';
14
- import { ADD_CONFIGURATION_ID } from './debugCommands.js';
15
- import { BaseActionViewItem, SelectActionViewItem } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionViewItems';
16
- import { debugStart } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
17
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
18
- import { defaultSelectBoxStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
19
-
20
- var StartDebugActionViewItem_1;
21
- const $ = $$1;
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, options, debugService, configurationService, commandService, contextService, contextViewService, keybindingService) {
26
- super(context, action, options);
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: ( localizeWithPath(
43
- 'vs/workbench/contrib/debug/browser/debugActionViewItems',
44
- 'debugLaunchConfigurations',
45
- 'Debug Launch Configurations'
46
- )) }
47
- ));
48
- this.selectBox.setFocusable(false);
49
- this.toDispose.push(this.selectBox);
50
- this.registerListeners();
51
- }
52
- registerListeners() {
53
- this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
54
- if (e.affectsConfiguration('launch')) {
55
- this.updateOptions();
56
- }
57
- }));
58
- this.toDispose.push(this.debugService.getConfigurationManager().onDidSelectConfiguration(() => {
59
- this.updateOptions();
60
- }));
61
- }
62
- render(container) {
63
- this.container = container;
64
- container.classList.add('start-debug-action-item');
65
- this.start = append(container, $(ThemeIcon.asCSSSelector(debugStart)));
66
- const keybinding = this.keybindingService.lookupKeybinding(this.action.id)?.getLabel();
67
- const keybindingLabel = keybinding ? ` (${keybinding})` : '';
68
- this.start.title = this.action.label + keybindingLabel;
69
- this.start.setAttribute('role', 'button');
70
- this.start.ariaLabel = this.start.title;
71
- this.toDispose.push(addDisposableListener(this.start, EventType.CLICK, () => {
72
- this.start.blur();
73
- if (this.debugService.state !== 1 ) {
74
- this.actionRunner.run(this.action, this.context);
75
- }
76
- }));
77
- this.toDispose.push(addDisposableListener(this.start, EventType.MOUSE_DOWN, (e) => {
78
- if (this.action.enabled && e.button === 0) {
79
- this.start.classList.add('active');
80
- }
81
- }));
82
- this.toDispose.push(addDisposableListener(this.start, EventType.MOUSE_UP, () => {
83
- this.start.classList.remove('active');
84
- }));
85
- this.toDispose.push(addDisposableListener(this.start, EventType.MOUSE_OUT, () => {
86
- this.start.classList.remove('active');
87
- }));
88
- this.toDispose.push(addDisposableListener(this.start, EventType.KEY_DOWN, (e) => {
89
- const event = ( new StandardKeyboardEvent(e));
90
- if (event.equals(17 )) {
91
- this.start.tabIndex = -1;
92
- this.selectBox.focus();
93
- event.stopPropagation();
94
- }
95
- }));
96
- this.toDispose.push(this.selectBox.onDidSelect(async (e) => {
97
- const target = this.debugOptions[e.index];
98
- const shouldBeSelected = target.handler ? await target.handler() : false;
99
- if (shouldBeSelected) {
100
- this.selected = e.index;
101
- }
102
- else {
103
- this.selectBox.select(this.selected);
104
- }
105
- }));
106
- const selectBoxContainer = $('.configuration');
107
- this.selectBox.render(append(container, selectBoxContainer));
108
- this.toDispose.push(addDisposableListener(selectBoxContainer, EventType.KEY_DOWN, (e) => {
109
- const event = ( new StandardKeyboardEvent(e));
110
- if (event.equals(15 )) {
111
- this.selectBox.setFocusable(false);
112
- this.start.tabIndex = 0;
113
- this.start.focus();
114
- event.stopPropagation();
115
- }
116
- }));
117
- this.container.style.border = `1px solid ${asCssVariable(selectBorder)}`;
118
- selectBoxContainer.style.borderLeft = `1px solid ${asCssVariable(selectBorder)}`;
119
- this.container.style.backgroundColor = asCssVariable(selectBackground);
120
- const configManager = this.debugService.getConfigurationManager();
121
- const updateDynamicConfigs = () => configManager.getDynamicProviders().then(providers => {
122
- if (providers.length !== this.providers.length) {
123
- this.providers = providers;
124
- this.updateOptions();
125
- }
126
- });
127
- this.toDispose.push(configManager.onDidChangeConfigurationProviders(updateDynamicConfigs));
128
- updateDynamicConfigs();
129
- this.updateOptions();
130
- }
131
- setActionContext(context) {
132
- this.context = context;
133
- }
134
- isEnabled() {
135
- return true;
136
- }
137
- focus(fromRight) {
138
- if (fromRight) {
139
- this.selectBox.focus();
140
- }
141
- else {
142
- this.start.tabIndex = 0;
143
- this.start.focus();
144
- }
145
- }
146
- blur() {
147
- this.start.tabIndex = -1;
148
- this.selectBox.blur();
149
- this.container.blur();
150
- }
151
- setFocusable(focusable) {
152
- if (focusable) {
153
- this.start.tabIndex = 0;
154
- }
155
- else {
156
- this.start.tabIndex = -1;
157
- this.selectBox.setFocusable(false);
158
- }
159
- }
160
- dispose() {
161
- this.toDispose = dispose(this.toDispose);
162
- super.dispose();
163
- }
164
- updateOptions() {
165
- this.selected = 0;
166
- this.debugOptions = [];
167
- const manager = this.debugService.getConfigurationManager();
168
- const inWorkspace = this.contextService.getWorkbenchState() === 3 ;
169
- let lastGroup;
170
- const disabledIdxs = [];
171
- manager.getAllConfigurations().forEach(({ launch, name, presentation }) => {
172
- if (lastGroup !== presentation?.group) {
173
- lastGroup = presentation?.group;
174
- if (this.debugOptions.length) {
175
- this.debugOptions.push({ label: StartDebugActionViewItem_1.SEPARATOR, handler: () => Promise.resolve(false) });
176
- disabledIdxs.push(this.debugOptions.length - 1);
177
- }
178
- }
179
- if (name === manager.selectedConfiguration.name && launch === manager.selectedConfiguration.launch) {
180
- this.selected = this.debugOptions.length;
181
- }
182
- const label = inWorkspace ? `${name} (${launch.name})` : name;
183
- this.debugOptions.push({
184
- label, handler: async () => {
185
- await manager.selectConfiguration(launch, name);
186
- return true;
187
- }
188
- });
189
- });
190
- manager.getRecentDynamicConfigurations().slice(0, 3).forEach(({ name, type }) => {
191
- if (type === manager.selectedConfiguration.type && manager.selectedConfiguration.name === name) {
192
- this.selected = this.debugOptions.length;
193
- }
194
- this.debugOptions.push({
195
- label: name,
196
- handler: async () => {
197
- await manager.selectConfiguration(undefined, name, undefined, { type });
198
- return true;
199
- }
200
- });
201
- });
202
- if (this.debugOptions.length === 0) {
203
- this.debugOptions.push({ label: ( localizeWithPath(
204
- 'vs/workbench/contrib/debug/browser/debugActionViewItems',
205
- 'noConfigurations',
206
- "No Configurations"
207
- )), handler: async () => false });
208
- }
209
- this.debugOptions.push({ label: StartDebugActionViewItem_1.SEPARATOR, handler: () => Promise.resolve(false) });
210
- disabledIdxs.push(this.debugOptions.length - 1);
211
- this.providers.forEach(p => {
212
- this.debugOptions.push({
213
- label: `${p.label}...`,
214
- handler: async () => {
215
- const picked = await p.pick();
216
- if (picked) {
217
- await manager.selectConfiguration(picked.launch, picked.config.name, picked.config, { type: p.type });
218
- return true;
219
- }
220
- return false;
221
- }
222
- });
223
- });
224
- manager.getLaunches().filter(l => !l.hidden).forEach(l => {
225
- const label = inWorkspace ? ( localizeWithPath(
226
- 'vs/workbench/contrib/debug/browser/debugActionViewItems',
227
- "addConfigTo",
228
- "Add Config ({0})...",
229
- l.name
230
- )) : ( localizeWithPath(
231
- 'vs/workbench/contrib/debug/browser/debugActionViewItems',
232
- 'addConfiguration',
233
- "Add Configuration..."
234
- ));
235
- this.debugOptions.push({
236
- label, handler: async () => {
237
- await this.commandService.executeCommand(ADD_CONFIGURATION_ID, ( l.uri.toString()));
238
- return false;
239
- }
240
- });
241
- });
242
- this.selectBox.setOptions(( this.debugOptions.map(
243
- (data, index) => ({ text: data.label, isDisabled: disabledIdxs.indexOf(index) !== -1 })
244
- )), this.selected);
245
- }
246
- };
247
- StartDebugActionViewItem = StartDebugActionViewItem_1 = ( __decorate([
248
- ( __param(3, IDebugService)),
249
- ( __param(4, IConfigurationService)),
250
- ( __param(5, ICommandService)),
251
- ( __param(6, IWorkspaceContextService)),
252
- ( __param(7, IContextViewService)),
253
- ( __param(8, IKeybindingService))
254
- ], StartDebugActionViewItem));
255
- let FocusSessionActionViewItem = class FocusSessionActionViewItem extends SelectActionViewItem {
256
- constructor(action, session, debugService, contextViewService, configurationService) {
257
- super(null, action, [], -1, contextViewService, defaultSelectBoxStyles, { ariaLabel: ( localizeWithPath(
258
- 'vs/workbench/contrib/debug/browser/debugActionViewItems',
259
- 'debugSession',
260
- 'Debug Session'
261
- )) });
262
- this.debugService = debugService;
263
- this.configurationService = configurationService;
264
- this._register(this.debugService.getViewModel().onDidFocusSession(() => {
265
- const session = this.getSelectedSession();
266
- if (session) {
267
- const index = this.getSessions().indexOf(session);
268
- this.select(index);
269
- }
270
- }));
271
- this._register(this.debugService.onDidNewSession(session => {
272
- const sessionListeners = [];
273
- sessionListeners.push(session.onDidChangeName(() => this.update()));
274
- sessionListeners.push(session.onDidEndAdapter(() => dispose(sessionListeners)));
275
- this.update();
276
- }));
277
- this.getSessions().forEach(session => {
278
- this._register(session.onDidChangeName(() => this.update()));
279
- });
280
- this._register(this.debugService.onDidEndSession(() => this.update()));
281
- const selectedSession = session ? this.mapFocusedSessionToSelected(session) : undefined;
282
- this.update(selectedSession);
283
- }
284
- getActionContext(_, index) {
285
- return this.getSessions()[index];
286
- }
287
- update(session) {
288
- if (!session) {
289
- session = this.getSelectedSession();
290
- }
291
- const sessions = this.getSessions();
292
- const names = ( sessions.map(s => {
293
- const label = s.getLabel();
294
- if (s.parentSession) {
295
- return `\u00A0\u00A0${label}`;
296
- }
297
- return label;
298
- }));
299
- this.setOptions(( names.map(data => ({ text: data }))), session ? sessions.indexOf(session) : undefined);
300
- }
301
- getSelectedSession() {
302
- const session = this.debugService.getViewModel().focusedSession;
303
- return session ? this.mapFocusedSessionToSelected(session) : undefined;
304
- }
305
- getSessions() {
306
- const showSubSessions = this.configurationService.getValue('debug').showSubSessionsInToolBar;
307
- const sessions = this.debugService.getModel().getSessions();
308
- return showSubSessions ? sessions : sessions.filter(s => !s.parentSession);
309
- }
310
- mapFocusedSessionToSelected(focusedSession) {
311
- const showSubSessions = this.configurationService.getValue('debug').showSubSessionsInToolBar;
312
- while (focusedSession.parentSession && !showSubSessions) {
313
- focusedSession = focusedSession.parentSession;
314
- }
315
- return focusedSession;
316
- }
317
- };
318
- FocusSessionActionViewItem = ( __decorate([
319
- ( __param(2, IDebugService)),
320
- ( __param(3, IContextViewService)),
321
- ( __param(4, IConfigurationService))
322
- ], FocusSessionActionViewItem));
323
-
324
- export { FocusSessionActionViewItem, StartDebugActionViewItem };