@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,314 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import * as browser from 'monaco-editor/esm/vs/base/browser/browser.js';
3
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
4
+ import { StandardMouseEvent } from 'monaco-editor/esm/vs/base/browser/mouseEvent.js';
5
+ import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
6
+ import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
7
+ import * as arrays from 'monaco-editor/esm/vs/base/common/arrays.js';
8
+ import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
9
+ import * as errors from 'monaco-editor/esm/vs/base/common/errors.js';
10
+ import { dispose, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
11
+ import './media/debugToolBar.css.js';
12
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
13
+ import { DropdownWithPrimaryActionViewItem } from 'vscode/vscode/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem';
14
+ import { createActionViewItem, createAndFillInActionBarActions } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
15
+ import { MenuRegistry, MenuId, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
16
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
17
+ import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
18
+ import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
19
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
20
+ import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
21
+ import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
22
+ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
23
+ import { widgetShadow, widgetBorder } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
24
+ import { Themable, IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
25
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
26
+ import { FocusSessionActionViewItem } from './debugActionViewItems.js';
27
+ import { debugToolBarBackground, debugToolBarBorder } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugColors';
28
+ import { CONTINUE_LABEL, CONTINUE_ID, PAUSE_LABEL, PAUSE_ID, DISCONNECT_ID, DISCONNECT_LABEL, STOP_LABEL, STOP_ID, STEP_OVER_LABEL, STEP_OVER_ID, STEP_INTO_LABEL, STEP_INTO_ID, STEP_OUT_LABEL, STEP_OUT_ID, STEP_BACK_ID, REVERSE_CONTINUE_ID, DISCONNECT_AND_SUSPEND_ID, DISCONNECT_AND_SUSPEND_LABEL, FOCUS_SESSION_ID, RESTART_LABEL, RESTART_SESSION_ID, FOCUS_SESSION_LABEL } from './debugCommands.js';
29
+ import { debugContinue, debugPause, debugDisconnect, debugStop, debugStepOver, debugStepInto, debugStepOut, debugStepBack, debugReverseContinue, debugGripper, debugRestart } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
30
+ import { VIEWLET_ID, CONTEXT_DEBUG_STATE, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, CONTEXT_MULTI_SESSION_DEBUG, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
31
+ import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
32
+
33
+ const DEBUG_TOOLBAR_POSITION_KEY = 'debug.actionswidgetposition';
34
+ const DEBUG_TOOLBAR_Y_KEY = 'debug.actionswidgety';
35
+ let DebugToolBar = class DebugToolBar extends Themable {
36
+ constructor(notificationService, telemetryService, debugService, layoutService, storageService, configurationService, themeService, instantiationService, menuService, contextKeyService) {
37
+ super(themeService);
38
+ this.notificationService = notificationService;
39
+ this.telemetryService = telemetryService;
40
+ this.debugService = debugService;
41
+ this.layoutService = layoutService;
42
+ this.storageService = storageService;
43
+ this.configurationService = configurationService;
44
+ this.instantiationService = instantiationService;
45
+ this.yCoordinate = 0;
46
+ this.isVisible = false;
47
+ this.isBuilt = false;
48
+ this.stopActionViewItemDisposables = this._register(( new DisposableStore()));
49
+ this.$el = dom.$('div.debug-toolbar');
50
+ this.$el.style.top = `${layoutService.offset.top}px`;
51
+ this.dragArea = dom.append(this.$el, dom.$('div.drag-area' + ThemeIcon.asCSSSelector(debugGripper)));
52
+ const actionBarContainer = dom.append(this.$el, dom.$('div.action-bar-container'));
53
+ this.debugToolBarMenu = menuService.createMenu(MenuId.DebugToolBar, contextKeyService);
54
+ this._register(this.debugToolBarMenu);
55
+ this.activeActions = [];
56
+ this.actionBar = this._register(( new ActionBar(actionBarContainer, {
57
+ orientation: 0 ,
58
+ actionViewItemProvider: (action) => {
59
+ if (action.id === FOCUS_SESSION_ID) {
60
+ return this.instantiationService.createInstance(FocusSessionActionViewItem, action, undefined);
61
+ }
62
+ else if (action.id === STOP_ID || action.id === DISCONNECT_ID) {
63
+ this.stopActionViewItemDisposables.clear();
64
+ const item = this.instantiationService.invokeFunction(accessor => createDisconnectMenuItemAction(action, this.stopActionViewItemDisposables, accessor));
65
+ if (item) {
66
+ return item;
67
+ }
68
+ }
69
+ return createActionViewItem(this.instantiationService, action);
70
+ }
71
+ })));
72
+ this.updateScheduler = this._register(( new RunOnceScheduler(() => {
73
+ const state = this.debugService.state;
74
+ const toolBarLocation = this.configurationService.getValue('debug').toolBarLocation;
75
+ if (state === 0 ||
76
+ toolBarLocation === 'docked' ||
77
+ toolBarLocation === 'hidden' ||
78
+ this.debugService.getModel().getSessions().every(s => s.suppressDebugToolbar) ||
79
+ (state === 1 && this.debugService.initializingOptions?.suppressDebugToolbar)) {
80
+ return this.hide();
81
+ }
82
+ const actions = [];
83
+ createAndFillInActionBarActions(this.debugToolBarMenu, { shouldForwardArgs: true }, actions);
84
+ if (!arrays.equals(actions, this.activeActions, (first, second) => first.id === second.id && first.enabled === second.enabled)) {
85
+ this.actionBar.clear();
86
+ this.actionBar.push(actions, { icon: true, label: false });
87
+ this.activeActions = actions;
88
+ }
89
+ this.show();
90
+ }, 20)));
91
+ this.updateStyles();
92
+ this.registerListeners();
93
+ this.hide();
94
+ }
95
+ registerListeners() {
96
+ this._register(this.debugService.onDidChangeState(() => this.updateScheduler.schedule()));
97
+ this._register(this.configurationService.onDidChangeConfiguration(e => {
98
+ if (e.affectsConfiguration('debug.toolBarLocation')) {
99
+ this.updateScheduler.schedule();
100
+ }
101
+ }));
102
+ this._register(this.debugToolBarMenu.onDidChange(() => this.updateScheduler.schedule()));
103
+ this._register(this.actionBar.actionRunner.onDidRun((e) => {
104
+ if (e.error && !errors.isCancellationError(e.error)) {
105
+ this.notificationService.error(e.error);
106
+ }
107
+ this.telemetryService.publicLog2('workbenchActionExecuted', { id: e.action.id, from: 'debugActionsWidget' });
108
+ }));
109
+ this._register(dom.addDisposableListener(window, dom.EventType.RESIZE, () => this.setCoordinates()));
110
+ this._register(dom.addDisposableGenericMouseUpListener(this.dragArea, (event) => {
111
+ const mouseClickEvent = ( new StandardMouseEvent(event));
112
+ if (mouseClickEvent.detail === 2) {
113
+ const widgetWidth = this.$el.clientWidth;
114
+ this.setCoordinates(0.5 * window.innerWidth - 0.5 * widgetWidth, 0);
115
+ this.storePosition();
116
+ }
117
+ }));
118
+ this._register(dom.addDisposableGenericMouseDownListener(this.dragArea, (event) => {
119
+ this.dragArea.classList.add('dragged');
120
+ const mouseMoveListener = dom.addDisposableGenericMouseMoveListener(window, (e) => {
121
+ const mouseMoveEvent = ( new StandardMouseEvent(e));
122
+ mouseMoveEvent.preventDefault();
123
+ this.setCoordinates(mouseMoveEvent.posx - 14, mouseMoveEvent.posy - (this.layoutService.offset.top));
124
+ });
125
+ const mouseUpListener = dom.addDisposableGenericMouseUpListener(window, (e) => {
126
+ this.storePosition();
127
+ this.dragArea.classList.remove('dragged');
128
+ mouseMoveListener.dispose();
129
+ mouseUpListener.dispose();
130
+ });
131
+ }));
132
+ this._register(this.layoutService.onDidChangePartVisibility(() => this.setYCoordinate()));
133
+ this._register(browser.PixelRatio.onDidChange(() => this.setYCoordinate()));
134
+ }
135
+ storePosition() {
136
+ const left = dom.getComputedStyle(this.$el).left;
137
+ if (left) {
138
+ const position = parseFloat(left) / window.innerWidth;
139
+ this.storageService.store(DEBUG_TOOLBAR_POSITION_KEY, position, 0 , 1 );
140
+ }
141
+ }
142
+ updateStyles() {
143
+ super.updateStyles();
144
+ if (this.$el) {
145
+ this.$el.style.backgroundColor = this.getColor(debugToolBarBackground) || '';
146
+ const widgetShadowColor = this.getColor(widgetShadow);
147
+ this.$el.style.boxShadow = widgetShadowColor ? `0 0 8px 2px ${widgetShadowColor}` : '';
148
+ const contrastBorderColor = this.getColor(widgetBorder);
149
+ const borderColor = this.getColor(debugToolBarBorder);
150
+ if (contrastBorderColor) {
151
+ this.$el.style.border = `1px solid ${contrastBorderColor}`;
152
+ }
153
+ else {
154
+ this.$el.style.border = borderColor ? `solid ${borderColor}` : 'none';
155
+ this.$el.style.border = '1px 0';
156
+ }
157
+ }
158
+ }
159
+ setYCoordinate(y = this.yCoordinate) {
160
+ const titlebarOffset = this.layoutService.offset.top;
161
+ this.$el.style.top = `${titlebarOffset + y}px`;
162
+ this.yCoordinate = y;
163
+ }
164
+ setCoordinates(x, y) {
165
+ if (!this.isVisible) {
166
+ return;
167
+ }
168
+ const widgetWidth = this.$el.clientWidth;
169
+ if (x === undefined) {
170
+ const positionPercentage = this.storageService.get(DEBUG_TOOLBAR_POSITION_KEY, 0 );
171
+ x = positionPercentage !== undefined ? parseFloat(positionPercentage) * window.innerWidth : (0.5 * window.innerWidth - 0.5 * widgetWidth);
172
+ }
173
+ x = Math.max(0, Math.min(x, window.innerWidth - widgetWidth));
174
+ this.$el.style.left = `${x}px`;
175
+ if (y === undefined) {
176
+ y = this.storageService.getNumber(DEBUG_TOOLBAR_Y_KEY, 0 , 0);
177
+ }
178
+ const titleAreaHeight = 35;
179
+ if ((y < titleAreaHeight / 2) || (y > titleAreaHeight + titleAreaHeight / 2)) {
180
+ const moveToTop = y < titleAreaHeight;
181
+ this.setYCoordinate(moveToTop ? 0 : titleAreaHeight);
182
+ this.storageService.store(DEBUG_TOOLBAR_Y_KEY, moveToTop ? 0 : 2 * titleAreaHeight, 0 , 1 );
183
+ }
184
+ }
185
+ show() {
186
+ if (this.isVisible) {
187
+ this.setCoordinates();
188
+ return;
189
+ }
190
+ if (!this.isBuilt) {
191
+ this.isBuilt = true;
192
+ this.layoutService.container.appendChild(this.$el);
193
+ }
194
+ this.isVisible = true;
195
+ dom.show(this.$el);
196
+ this.setCoordinates();
197
+ }
198
+ hide() {
199
+ this.isVisible = false;
200
+ dom.hide(this.$el);
201
+ }
202
+ dispose() {
203
+ super.dispose();
204
+ this.$el?.remove();
205
+ }
206
+ };
207
+ DebugToolBar = ( __decorate([
208
+ ( __param(0, INotificationService)),
209
+ ( __param(1, ITelemetryService)),
210
+ ( __param(2, IDebugService)),
211
+ ( __param(3, IWorkbenchLayoutService)),
212
+ ( __param(4, IStorageService)),
213
+ ( __param(5, IConfigurationService)),
214
+ ( __param(6, IThemeService)),
215
+ ( __param(7, IInstantiationService)),
216
+ ( __param(8, IMenuService)),
217
+ ( __param(9, IContextKeyService))
218
+ ], DebugToolBar));
219
+ function createDisconnectMenuItemAction(action, disposables, accessor) {
220
+ const menuService = accessor.get(IMenuService);
221
+ const contextKeyService = accessor.get(IContextKeyService);
222
+ const instantiationService = accessor.get(IInstantiationService);
223
+ const contextMenuService = accessor.get(IContextMenuService);
224
+ const menu = menuService.createMenu(MenuId.DebugToolBarStop, contextKeyService);
225
+ const secondary = [];
226
+ createAndFillInActionBarActions(menu, { shouldForwardArgs: true }, secondary);
227
+ if (!secondary.length) {
228
+ return undefined;
229
+ }
230
+ const dropdownAction = disposables.add(( new Action('notebook.moreRunActions', ( localize('notebook.moreRunActionsLabel', "More...")), 'codicon-chevron-down', true)));
231
+ const item = instantiationService.createInstance(DropdownWithPrimaryActionViewItem, action, dropdownAction, secondary, 'debug-stop-actions', contextMenuService, {});
232
+ return item;
233
+ }
234
+ const debugViewTitleItems = [];
235
+ const registerDebugToolBarItem = (id, title, order, icon, when, precondition, alt) => {
236
+ MenuRegistry.appendMenuItem(MenuId.DebugToolBar, {
237
+ group: 'navigation',
238
+ when,
239
+ order,
240
+ command: {
241
+ id,
242
+ title,
243
+ icon,
244
+ precondition
245
+ },
246
+ alt
247
+ });
248
+ debugViewTitleItems.push(MenuRegistry.appendMenuItem(MenuId.ViewContainerTitle, {
249
+ group: 'navigation',
250
+ when: ( ContextKeyExpr.and(when, ( ContextKeyExpr.equals('viewContainer', VIEWLET_ID)), ( CONTEXT_DEBUG_STATE.notEqualsTo('inactive')), ( ContextKeyExpr.equals('config.debug.toolBarLocation', 'docked')))),
251
+ order,
252
+ command: {
253
+ id,
254
+ title,
255
+ icon,
256
+ precondition
257
+ }
258
+ }));
259
+ };
260
+ MenuRegistry.onDidChangeMenu(e => {
261
+ if (( e.has(MenuId.DebugToolBar))) {
262
+ dispose(debugViewTitleItems);
263
+ const items = MenuRegistry.getMenuItems(MenuId.DebugToolBar);
264
+ for (const i of items) {
265
+ debugViewTitleItems.push(MenuRegistry.appendMenuItem(MenuId.ViewContainerTitle, {
266
+ ...i,
267
+ when: ( ContextKeyExpr.and(i.when, ( ContextKeyExpr.equals('viewContainer', VIEWLET_ID)), ( CONTEXT_DEBUG_STATE.notEqualsTo('inactive')), ( ContextKeyExpr.equals('config.debug.toolBarLocation', 'docked'))))
268
+ }));
269
+ }
270
+ }
271
+ });
272
+ registerDebugToolBarItem(CONTINUE_ID, CONTINUE_LABEL, 10, debugContinue, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
273
+ registerDebugToolBarItem(PAUSE_ID, PAUSE_LABEL, 10, debugPause, ( CONTEXT_DEBUG_STATE.notEqualsTo('stopped')), ( CONTEXT_DEBUG_STATE.isEqualTo('running')));
274
+ registerDebugToolBarItem(STOP_ID, STOP_LABEL, 70, debugStop, ( CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated()), undefined, { id: DISCONNECT_ID, title: DISCONNECT_LABEL, icon: debugDisconnect, precondition: ( ContextKeyExpr.and(( CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated()), CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)), });
275
+ registerDebugToolBarItem(DISCONNECT_ID, DISCONNECT_LABEL, 70, debugDisconnect, CONTEXT_FOCUSED_SESSION_IS_ATTACH, undefined, { id: STOP_ID, title: STOP_LABEL, icon: debugStop, precondition: ( ContextKeyExpr.and(CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)), });
276
+ registerDebugToolBarItem(STEP_OVER_ID, STEP_OVER_LABEL, 20, debugStepOver, undefined, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
277
+ registerDebugToolBarItem(STEP_INTO_ID, STEP_INTO_LABEL, 30, debugStepInto, undefined, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
278
+ registerDebugToolBarItem(STEP_OUT_ID, STEP_OUT_LABEL, 40, debugStepOut, undefined, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
279
+ registerDebugToolBarItem(RESTART_SESSION_ID, RESTART_LABEL, 60, debugRestart);
280
+ registerDebugToolBarItem(STEP_BACK_ID, ( localize('stepBackDebug', "Step Back")), 50, debugStepBack, CONTEXT_STEP_BACK_SUPPORTED, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
281
+ registerDebugToolBarItem(REVERSE_CONTINUE_ID, ( localize('reverseContinue', "Reverse")), 55, debugReverseContinue, CONTEXT_STEP_BACK_SUPPORTED, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
282
+ registerDebugToolBarItem(FOCUS_SESSION_ID, FOCUS_SESSION_LABEL, 100, undefined, CONTEXT_MULTI_SESSION_DEBUG);
283
+ MenuRegistry.appendMenuItem(MenuId.DebugToolBarStop, {
284
+ group: 'navigation',
285
+ when: ( ContextKeyExpr.and(( CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated()), CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)),
286
+ order: 0,
287
+ command: {
288
+ id: DISCONNECT_ID,
289
+ title: DISCONNECT_LABEL,
290
+ icon: debugDisconnect
291
+ }
292
+ });
293
+ MenuRegistry.appendMenuItem(MenuId.DebugToolBarStop, {
294
+ group: 'navigation',
295
+ when: ( ContextKeyExpr.and(CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)),
296
+ order: 0,
297
+ command: {
298
+ id: STOP_ID,
299
+ title: STOP_LABEL,
300
+ icon: debugStop
301
+ }
302
+ });
303
+ MenuRegistry.appendMenuItem(MenuId.DebugToolBarStop, {
304
+ group: 'navigation',
305
+ when: ( ContextKeyExpr.or(( ContextKeyExpr.and(( CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated()), CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)), ( ContextKeyExpr.and(CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED)))),
306
+ order: 0,
307
+ command: {
308
+ id: DISCONNECT_AND_SUSPEND_ID,
309
+ title: DISCONNECT_AND_SUSPEND_LABEL,
310
+ icon: debugDisconnect
311
+ }
312
+ });
313
+
314
+ export { DebugToolBar, createDisconnectMenuItemAction };
@@ -0,0 +1,168 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableStore, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import './media/debugViewlet.css.js';
4
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
5
+ import { createActionViewItem } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
6
+ import { registerAction2, Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
7
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
8
+ import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
9
+ import { IContextMenuService, IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
10
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
11
+ import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
12
+ import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
13
+ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
14
+ import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
15
+ import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
16
+ import { ViewsSubMenu, ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
17
+ import { IViewsService, IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
18
+ import { StartDebugActionViewItem, FocusSessionActionViewItem } from './debugActionViewItems.js';
19
+ import { DEBUG_START_COMMAND_ID, FOCUS_SESSION_ID, STOP_ID, DISCONNECT_ID } from './debugCommands.js';
20
+ import { createDisconnectMenuItemAction } from './debugToolBar.js';
21
+ import { WelcomeView } from './welcomeView.js';
22
+ import { REPL_VIEW_ID, VIEWLET_ID, CONTEXT_DEBUG_UX_KEY, BREAKPOINTS_VIEW_ID, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
23
+ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
24
+ import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
25
+
26
+ let DebugViewPaneContainer = class DebugViewPaneContainer extends ViewPaneContainer {
27
+ constructor(layoutService, telemetryService, progressService, debugService, instantiationService, contextService, storageService, themeService, contextMenuService, extensionService, configurationService, contextViewService, contextKeyService, viewDescriptorService) {
28
+ super(VIEWLET_ID, { mergeViewWithContainerWhenSingleView: true }, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService);
29
+ this.progressService = progressService;
30
+ this.debugService = debugService;
31
+ this.contextViewService = contextViewService;
32
+ this.contextKeyService = contextKeyService;
33
+ this.paneListeners = ( new Map());
34
+ this.stopActionViewItemDisposables = this._register(( new DisposableStore()));
35
+ this._register(this.debugService.onDidChangeState(state => this.onDebugServiceStateChange(state)));
36
+ this._register(this.contextKeyService.onDidChangeContext(e => {
37
+ if (e.affectsSome(( new Set([CONTEXT_DEBUG_UX_KEY])))) {
38
+ this.updateTitleArea();
39
+ }
40
+ }));
41
+ this._register(this.contextService.onDidChangeWorkbenchState(() => this.updateTitleArea()));
42
+ this._register(this.configurationService.onDidChangeConfiguration(e => {
43
+ if (e.affectsConfiguration('debug.toolBarLocation')) {
44
+ this.updateTitleArea();
45
+ }
46
+ }));
47
+ }
48
+ create(parent) {
49
+ super.create(parent);
50
+ parent.classList.add('debug-viewlet');
51
+ }
52
+ focus() {
53
+ super.focus();
54
+ if (this.startDebugActionViewItem) {
55
+ this.startDebugActionViewItem.focus();
56
+ }
57
+ else {
58
+ this.focusView(WelcomeView.ID);
59
+ }
60
+ }
61
+ getActionViewItem(action) {
62
+ if (action.id === DEBUG_START_COMMAND_ID) {
63
+ this.startDebugActionViewItem = this.instantiationService.createInstance(StartDebugActionViewItem, null, action);
64
+ return this.startDebugActionViewItem;
65
+ }
66
+ if (action.id === FOCUS_SESSION_ID) {
67
+ return ( new FocusSessionActionViewItem(
68
+ action,
69
+ undefined,
70
+ this.debugService,
71
+ this.contextViewService,
72
+ this.configurationService
73
+ ));
74
+ }
75
+ if (action.id === STOP_ID || action.id === DISCONNECT_ID) {
76
+ this.stopActionViewItemDisposables.clear();
77
+ const item = this.instantiationService.invokeFunction(accessor => createDisconnectMenuItemAction(action, this.stopActionViewItemDisposables, accessor));
78
+ if (item) {
79
+ return item;
80
+ }
81
+ }
82
+ return createActionViewItem(this.instantiationService, action);
83
+ }
84
+ focusView(id) {
85
+ const view = this.getView(id);
86
+ if (view) {
87
+ view.focus();
88
+ }
89
+ }
90
+ onDebugServiceStateChange(state) {
91
+ if (this.progressResolve) {
92
+ this.progressResolve();
93
+ this.progressResolve = undefined;
94
+ }
95
+ if (state === 1 ) {
96
+ this.progressService.withProgress({ location: VIEWLET_ID, }, _progress => {
97
+ return ( new Promise(resolve => this.progressResolve = resolve));
98
+ });
99
+ }
100
+ }
101
+ addPanes(panes) {
102
+ super.addPanes(panes);
103
+ for (const { pane: pane } of panes) {
104
+ if (pane.id === BREAKPOINTS_VIEW_ID) {
105
+ this.breakpointView = pane;
106
+ this.updateBreakpointsMaxSize();
107
+ }
108
+ else {
109
+ this.paneListeners.set(pane.id, pane.onDidChange(() => this.updateBreakpointsMaxSize()));
110
+ }
111
+ }
112
+ }
113
+ removePanes(panes) {
114
+ super.removePanes(panes);
115
+ for (const pane of panes) {
116
+ dispose(this.paneListeners.get(pane.id));
117
+ this.paneListeners.delete(pane.id);
118
+ }
119
+ }
120
+ updateBreakpointsMaxSize() {
121
+ if (this.breakpointView) {
122
+ const allOtherCollapsed = this.panes.every(view => !view.isExpanded() || view === this.breakpointView);
123
+ this.breakpointView.maximumBodySize = allOtherCollapsed ? Number.POSITIVE_INFINITY : this.breakpointView.minimumBodySize;
124
+ }
125
+ }
126
+ };
127
+ DebugViewPaneContainer = ( __decorate([
128
+ ( __param(0, IWorkbenchLayoutService)),
129
+ ( __param(1, ITelemetryService)),
130
+ ( __param(2, IProgressService)),
131
+ ( __param(3, IDebugService)),
132
+ ( __param(4, IInstantiationService)),
133
+ ( __param(5, IWorkspaceContextService)),
134
+ ( __param(6, IStorageService)),
135
+ ( __param(7, IThemeService)),
136
+ ( __param(8, IContextMenuService)),
137
+ ( __param(9, IExtensionService)),
138
+ ( __param(10, IConfigurationService)),
139
+ ( __param(11, IContextViewService)),
140
+ ( __param(12, IContextKeyService)),
141
+ ( __param(13, IViewDescriptorService))
142
+ ], DebugViewPaneContainer));
143
+ registerAction2(class extends Action2 {
144
+ constructor() {
145
+ super({
146
+ id: 'debug.toggleReplIgnoreFocus',
147
+ title: ( nls.localize('debugPanel', "Debug Console")),
148
+ toggled: ( ContextKeyExpr.has(`view.${REPL_VIEW_ID}.visible`)),
149
+ menu: [{
150
+ id: ViewsSubMenu,
151
+ group: '3_toggleRepl',
152
+ order: 30,
153
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('viewContainer', VIEWLET_ID))))
154
+ }]
155
+ });
156
+ }
157
+ async run(accessor) {
158
+ const viewsService = accessor.get(IViewsService);
159
+ if (viewsService.isViewVisible(REPL_VIEW_ID)) {
160
+ viewsService.closeView(REPL_VIEW_ID);
161
+ }
162
+ else {
163
+ await viewsService.openView(REPL_VIEW_ID);
164
+ }
165
+ }
166
+ });
167
+
168
+ export { DebugViewPaneContainer };