@codingame/monaco-vscode-view-common-service-override 4.5.1 → 5.0.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 (70) hide show
  1. package/package.json +3 -3
  2. package/viewCommon.js +3 -6
  3. package/vscode/src/vs/base/browser/ui/grid/grid.js +12 -12
  4. package/vscode/src/vs/base/browser/ui/grid/gridview.js +26 -26
  5. package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +4 -3
  6. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +142 -221
  7. package/vscode/src/vs/workbench/browser/actions/listCommands.js +49 -45
  8. package/vscode/src/vs/workbench/browser/actions/navigationActions.js +7 -30
  9. package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
  10. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +67 -138
  11. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +25 -38
  12. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +1 -1
  13. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +26 -27
  14. package/vscode/src/vs/workbench/browser/parts/compositePart.js +20 -34
  15. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +7 -4
  16. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +216 -765
  17. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +27 -42
  18. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +24 -23
  19. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +54 -19
  20. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +122 -72
  21. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +51 -54
  22. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +44 -44
  23. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +25 -26
  24. package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +1 -1
  25. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +2 -5
  26. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +22 -22
  27. package/vscode/src/vs/workbench/browser/window.js +41 -92
  28. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +41 -78
  29. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -46
  30. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +36 -27
  31. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +1 -1
  32. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +1 -1
  33. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +14 -15
  34. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +10 -11
  35. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +1 -1
  36. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +25 -52
  37. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +59 -88
  38. package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +18 -48
  39. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +61 -150
  40. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +15 -70
  41. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +9 -20
  42. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +14 -65
  43. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +39 -113
  44. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +1 -0
  45. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +13 -19
  46. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +1 -0
  47. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +35 -75
  48. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +16 -37
  49. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +41 -43
  50. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +6 -5
  51. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +13 -11
  52. package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +24 -61
  53. package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +7 -6
  54. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +37 -70
  55. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -46
  56. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +26 -27
  57. package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +2 -2
  58. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +50 -52
  59. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +5 -3
  60. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +18 -34
  61. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +7 -10
  62. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +13 -11
  63. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.js +2 -2
  64. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +79 -49
  65. package/vscode/src/vs/workbench/services/driver/browser/driver.js +9 -7
  66. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +45 -68
  67. package/vscode/src/vs/workbench/services/history/browser/historyService.js +95 -98
  68. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +34 -74
  69. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +69 -67
  70. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +52 -47
@@ -13,62 +13,47 @@ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/service
13
13
  import { getLargeFileConfirmationLimit, ByteSize } from 'vscode/vscode/vs/platform/files/common/files';
14
14
 
15
15
  var DynamicEditorConfigurations_1;
16
+ const _moduleId = "vs/workbench/browser/parts/editor/editorConfiguration";
16
17
  let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disposable {
17
18
  static { DynamicEditorConfigurations_1 = this; }
18
19
  static { this.ID = 'workbench.contrib.dynamicEditorConfigurations'; }
19
- static { this.AUTO_LOCK_DEFAULT_ENABLED = ( new Set([
20
+ static { this.AUTO_LOCK_DEFAULT_ENABLED = ( (new Set([
20
21
  'terminalEditor',
21
22
  'mainThreadWebview-simpleBrowser.view',
22
23
  'mainThreadWebview-browserPreview'
23
- ])); }
24
+ ]))); }
24
25
  static { this.AUTO_LOCK_EXTRA_EDITORS = [
25
26
  {
26
27
  id: 'workbench.input.interactive',
27
- label: ( localizeWithPath(
28
- 'vs/workbench/browser/parts/editor/editorConfiguration',
29
- 'interactiveWindow',
30
- 'Interactive Window'
31
- )),
28
+ label: ( localizeWithPath(_moduleId, 0, 'Interactive Window')),
32
29
  priority: RegisteredEditorPriority.builtin
33
30
  },
34
31
  {
35
32
  id: 'mainThreadWebview-markdown.preview',
36
- label: ( localizeWithPath(
37
- 'vs/workbench/browser/parts/editor/editorConfiguration',
38
- 'markdownPreview',
39
- "Markdown Preview"
40
- )),
33
+ label: ( localizeWithPath(_moduleId, 1, "Markdown Preview")),
41
34
  priority: RegisteredEditorPriority.builtin
42
35
  },
43
36
  {
44
37
  id: 'mainThreadWebview-simpleBrowser.view',
45
- label: ( localizeWithPath(
46
- 'vs/workbench/browser/parts/editor/editorConfiguration',
47
- 'simpleBrowser',
48
- "Simple Browser"
49
- )),
38
+ label: ( localizeWithPath(_moduleId, 2, "Simple Browser")),
50
39
  priority: RegisteredEditorPriority.builtin
51
40
  },
52
41
  {
53
42
  id: 'mainThreadWebview-browserPreview',
54
- label: ( localizeWithPath(
55
- 'vs/workbench/browser/parts/editor/editorConfiguration',
56
- 'livePreview',
57
- "Live Preview"
58
- )),
43
+ label: ( localizeWithPath(_moduleId, 3, "Live Preview")),
59
44
  priority: RegisteredEditorPriority.builtin
60
45
  }
61
46
  ]; }
62
- static { this.AUTO_LOCK_REMOVE_EDITORS = ( new Set([
47
+ static { this.AUTO_LOCK_REMOVE_EDITORS = ( (new Set([
63
48
  'vscode-interactive-input',
64
49
  'interactive',
65
50
  'vscode.markdown.preview.editor'
66
- ])); }
51
+ ]))); }
67
52
  constructor(editorResolverService, extensionService, environmentService) {
68
53
  super();
69
54
  this.editorResolverService = editorResolverService;
70
55
  this.environmentService = environmentService;
71
- this.configurationRegistry = ( Registry.as(Extensions.Configuration));
56
+ this.configurationRegistry = ( (Registry.as(Extensions.Configuration)));
72
57
  (async () => {
73
58
  await extensionService.whenInstalledExtensionsRegistered();
74
59
  this.updateDynamicEditorConfigurations();
@@ -79,19 +64,19 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
79
64
  this._register(Event.debounce(this.editorResolverService.onDidChangeEditorRegistrations, (_, e) => e)(() => this.updateDynamicEditorConfigurations()));
80
65
  }
81
66
  updateDynamicEditorConfigurations() {
82
- const lockableEditors = [...this.editorResolverService.getEditors(), ...DynamicEditorConfigurations_1.AUTO_LOCK_EXTRA_EDITORS].filter(e => !( DynamicEditorConfigurations_1.AUTO_LOCK_REMOVE_EDITORS.has(e.id)));
83
- const binaryEditorCandidates = ( this.editorResolverService.getEditors().filter(e => e.priority !== RegisteredEditorPriority.exclusive).map(e => e.id));
67
+ const lockableEditors = [...this.editorResolverService.getEditors(), ...DynamicEditorConfigurations_1.AUTO_LOCK_EXTRA_EDITORS].filter(e => !( (DynamicEditorConfigurations_1.AUTO_LOCK_REMOVE_EDITORS.has(e.id))));
68
+ const binaryEditorCandidates = ( (this.editorResolverService.getEditors().filter(e => e.priority !== RegisteredEditorPriority.exclusive).map(e => e.id)));
84
69
  const autoLockGroupConfiguration = Object.create(null);
85
70
  for (const editor of lockableEditors) {
86
71
  autoLockGroupConfiguration[editor.id] = {
87
72
  type: 'boolean',
88
- default: ( DynamicEditorConfigurations_1.AUTO_LOCK_DEFAULT_ENABLED.has(editor.id)),
73
+ default: ( (DynamicEditorConfigurations_1.AUTO_LOCK_DEFAULT_ENABLED.has(editor.id))),
89
74
  description: editor.label
90
75
  };
91
76
  }
92
77
  const defaultAutoLockGroupConfiguration = Object.create(null);
93
78
  for (const editor of lockableEditors) {
94
- defaultAutoLockGroupConfiguration[editor.id] = ( DynamicEditorConfigurations_1.AUTO_LOCK_DEFAULT_ENABLED.has(editor.id));
79
+ defaultAutoLockGroupConfiguration[editor.id] = ( (DynamicEditorConfigurations_1.AUTO_LOCK_DEFAULT_ENABLED.has(editor.id)));
95
80
  }
96
81
  const oldAutoLockConfigurationNode = this.autoLockConfigurationNode;
97
82
  this.autoLockConfigurationNode = {
@@ -100,8 +85,8 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
100
85
  'workbench.editor.autoLockGroups': {
101
86
  type: 'object',
102
87
  description: ( localizeWithPath(
103
- 'vs/workbench/browser/parts/editor/editorConfiguration',
104
- 'workbench.editor.autoLockGroups',
88
+ _moduleId,
89
+ 4,
105
90
  "If an editor matching one of the listed types is opened as the first in an editor group and more than one group is open, the group is automatically locked. Locked groups will only be used for opening editors when explicitly chosen by a user gesture (for example drag and drop), but not by default. Consequently, the active editor in a locked group is less likely to be replaced accidentally with a different editor."
106
91
  )),
107
92
  properties: autoLockGroupConfiguration,
@@ -119,8 +104,8 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
119
104
  default: '',
120
105
  enum: [...binaryEditorCandidates, ''],
121
106
  description: ( localizeWithPath(
122
- 'vs/workbench/browser/parts/editor/editorConfiguration',
123
- 'workbench.editor.defaultBinaryEditor',
107
+ _moduleId,
108
+ 5,
124
109
  "The default editor for files detected as binary. If undefined, the user will be presented with a picker."
125
110
  )),
126
111
  }
@@ -133,8 +118,8 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
133
118
  'workbench.editorAssociations': {
134
119
  type: 'object',
135
120
  markdownDescription: ( localizeWithPath(
136
- 'vs/workbench/browser/parts/editor/editorConfiguration',
137
- 'editor.editorAssociations',
121
+ _moduleId,
122
+ 6,
138
123
  "Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `\"*.hex\": \"hexEditor.hexedit\"`). These have precedence over the default behavior."
139
124
  )),
140
125
  patternProperties: {
@@ -156,8 +141,8 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
156
141
  minimum: 1,
157
142
  scope: 4 ,
158
143
  markdownDescription: ( localizeWithPath(
159
- 'vs/workbench/browser/parts/editor/editorConfiguration',
160
- 'editorLargeFileSizeConfirmation',
144
+ _moduleId,
145
+ 7,
161
146
  "Controls the minimum size of a file in MB before asking for confirmation when opening in the editor. Note that this setting may not apply to all editor types and environments."
162
147
  )),
163
148
  }
@@ -179,10 +164,10 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
179
164
  });
180
165
  }
181
166
  };
182
- DynamicEditorConfigurations = DynamicEditorConfigurations_1 = ( __decorate([
183
- ( __param(0, IEditorResolverService)),
184
- ( __param(1, IExtensionService)),
185
- ( __param(2, IWorkbenchEnvironmentService))
186
- ], DynamicEditorConfigurations));
167
+ DynamicEditorConfigurations = DynamicEditorConfigurations_1 = ( (__decorate([
168
+ ( (__param(0, IEditorResolverService))),
169
+ ( (__param(1, IExtensionService))),
170
+ ( (__param(2, IWorkbenchEnvironmentService)))
171
+ ], DynamicEditorConfigurations)));
187
172
 
188
173
  export { DynamicEditorConfigurations };
@@ -36,6 +36,7 @@ import { ITreeViewsDnDService } from 'vscode/vscode/vs/editor/common/services/tr
36
36
  import { DraggedTreeItemsIdentifier } from 'vscode/vscode/vs/editor/common/services/treeViewsDnd';
37
37
 
38
38
  var DropOverlay_1;
39
+ const _moduleId = "vs/workbench/browser/parts/editor/editorDropTarget";
39
40
  function isDropIntoEditorEnabledGlobally(configurationService) {
40
41
  return configurationService.getValue('editor.dropIntoEditor.enabled');
41
42
  }
@@ -58,7 +59,7 @@ let DropOverlay = class DropOverlay extends Themable {
58
59
  this.editorTransfer = LocalSelectionTransfer.getInstance();
59
60
  this.groupTransfer = LocalSelectionTransfer.getInstance();
60
61
  this.treeItemsTransfer = LocalSelectionTransfer.getInstance();
61
- this.cleanupOverlayScheduler = this._register(( new RunOnceScheduler(() => this.dispose(), 300)));
62
+ this.cleanupOverlayScheduler = this._register(( (new RunOnceScheduler(() => this.dispose(), 300))));
62
63
  this.enableDropIntoEditor = isDropIntoEditorEnabledGlobally(this.configurationService) && this.isDropIntoActiveEditorEnabled();
63
64
  this.create();
64
65
  }
@@ -78,8 +79,8 @@ let DropOverlay = class DropOverlay extends Themable {
78
79
  container.appendChild(this.overlay);
79
80
  if (this.enableDropIntoEditor) {
80
81
  this.dropIntoPromptElement = renderFormattedText(( localizeWithPath(
81
- 'vs/workbench/browser/parts/editor/editorDropTarget',
82
- 'dropIntoEditorPrompt',
82
+ _moduleId,
83
+ 0,
83
84
  "Hold __{0}__ to drop into editor",
84
85
  isMacintosh ? '⇧' : 'Shift'
85
86
  )), {});
@@ -112,7 +113,7 @@ let DropOverlay = class DropOverlay extends Themable {
112
113
  }
113
114
  }
114
115
  registerListeners(container) {
115
- this._register(( new DragAndDropObserver(container, {
116
+ this._register(( (new DragAndDropObserver(container, {
116
117
  onDragOver: e => {
117
118
  if (this.enableDropIntoEditor && isDragIntoEditorEvent(e)) {
118
119
  this.dispose();
@@ -160,7 +161,7 @@ let DropOverlay = class DropOverlay extends Themable {
160
161
  this.handleDrop(e, this.currentDropOperation.splitDirection);
161
162
  }
162
163
  }
163
- })));
164
+ }))));
164
165
  this._register(addDisposableListener(container, EventType.MOUSE_OVER, () => {
165
166
  if (!this.cleanupOverlayScheduler.isScheduled()) {
166
167
  this.cleanupOverlayScheduler.schedule();
@@ -267,7 +268,7 @@ let DropOverlay = class DropOverlay extends Themable {
267
268
  const dataTransferItem = await this.treeViewsDragAndDropService.removeDragOperationTransfer(id.identifier);
268
269
  if (dataTransferItem) {
269
270
  const treeDropData = await extractTreeDropData(dataTransferItem);
270
- editors.push(...( treeDropData.map(editor => ({ ...editor, options: { ...editor.options, pinned: true } }))));
271
+ editors.push(...( (treeDropData.map(editor => ({ ...editor, options: { ...editor.options, pinned: true } })))));
271
272
  }
272
273
  }
273
274
  if (editors.length) {
@@ -420,15 +421,15 @@ let DropOverlay = class DropOverlay extends Themable {
420
421
  this._disposed = true;
421
422
  }
422
423
  };
423
- DropOverlay = DropOverlay_1 = ( __decorate([
424
- ( __param(1, IThemeService)),
425
- ( __param(2, IConfigurationService)),
426
- ( __param(3, IInstantiationService)),
427
- ( __param(4, IEditorService)),
428
- ( __param(5, IEditorGroupsService)),
429
- ( __param(6, ITreeViewsDnDService)),
430
- ( __param(7, IWorkspaceContextService))
431
- ], DropOverlay));
424
+ DropOverlay = DropOverlay_1 = ( (__decorate([
425
+ ( (__param(1, IThemeService))),
426
+ ( (__param(2, IConfigurationService))),
427
+ ( (__param(3, IInstantiationService))),
428
+ ( (__param(4, IEditorService))),
429
+ ( (__param(5, IEditorGroupsService))),
430
+ ( (__param(6, ITreeViewsDnDService))),
431
+ ( (__param(7, IWorkspaceContextService)))
432
+ ], DropOverlay)));
432
433
  let EditorDropTarget = class EditorDropTarget extends Themable {
433
434
  constructor(container, delegate, editorGroupService, themeService, configurationService, instantiationService) {
434
435
  super(themeService);
@@ -463,8 +464,8 @@ let EditorDropTarget = class EditorDropTarget extends Themable {
463
464
  if (!this.editorTransfer.hasData(DraggedEditorIdentifier.prototype) &&
464
465
  !this.groupTransfer.hasData(DraggedEditorGroupIdentifier.prototype) &&
465
466
  event.dataTransfer) {
466
- const dndContributions = ( Registry.as(Extensions.DragAndDropContribution)).getAll();
467
- const dndContributionKeys = ( Array.from(dndContributions).map(e => e.dataFormatKey));
467
+ const dndContributions = ( (Registry.as(Extensions.DragAndDropContribution))).getAll();
468
+ const dndContributionKeys = ( (Array.from(dndContributions).map(e => e.dataFormatKey)));
468
469
  if (!containsDragType(event, DataTransfers.FILES, CodeDataTransfers.FILES, DataTransfers.RESOURCES, CodeDataTransfers.EDITORS, ...dndContributionKeys)) {
469
470
  event.dataTransfer.dropEffect = 'none';
470
471
  return;
@@ -513,11 +514,11 @@ let EditorDropTarget = class EditorDropTarget extends Themable {
513
514
  }
514
515
  }
515
516
  };
516
- EditorDropTarget = ( __decorate([
517
- ( __param(2, IEditorGroupsService)),
518
- ( __param(3, IThemeService)),
519
- ( __param(4, IConfigurationService)),
520
- ( __param(5, IInstantiationService))
521
- ], EditorDropTarget));
517
+ EditorDropTarget = ( (__decorate([
518
+ ( (__param(2, IEditorGroupsService))),
519
+ ( (__param(3, IThemeService))),
520
+ ( (__param(4, IConfigurationService))),
521
+ ( (__param(5, IInstantiationService)))
522
+ ], EditorDropTarget)));
522
523
 
523
524
  export { EditorDropTarget };
@@ -2,7 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
3
3
  import { Part } from 'vscode/vscode/vs/workbench/browser/part';
4
4
  import { $, getWindow, getActiveElement, isAncestorOfActiveElement, addDisposableGenericMouseDownListener, EventHelper, Dimension } from 'vscode/vscode/vs/base/browser/dom';
5
- import { Relay, Event, Emitter } from 'vscode/vscode/vs/base/common/event';
5
+ import { Relay, Event, Emitter, PauseableEmitter } from 'vscode/vscode/vs/base/common/event';
6
6
  import 'vscode/vscode/vs/platform/theme/common/colorUtils';
7
7
  import { contrastBorder } from 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
8
8
  import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
@@ -104,7 +104,7 @@ let EditorPart = class EditorPart extends Part {
104
104
  this.onDidActivateGroup = this._onDidActivateGroup.event;
105
105
  this._onDidAddGroup = this._register(( new Emitter()));
106
106
  this.onDidAddGroup = this._onDidAddGroup.event;
107
- this._onDidRemoveGroup = this._register(( new Emitter()));
107
+ this._onDidRemoveGroup = this._register(( new PauseableEmitter()));
108
108
  this.onDidRemoveGroup = this._onDidRemoveGroup.event;
109
109
  this._onDidMoveGroup = this._register(( new Emitter()));
110
110
  this.onDidMoveGroup = this._onDidMoveGroup.event;
@@ -224,7 +224,7 @@ let EditorPart = class EditorPart extends Part {
224
224
  if (typeof scope.location === 'number') {
225
225
  return this.doFindGroupByLocation(scope.location, source, wrap);
226
226
  }
227
- throw new Error('invalid arguments');
227
+ throw ( new Error('invalid arguments'));
228
228
  }
229
229
  doFindGroupByDirection(direction, source, wrap) {
230
230
  const sourceGroupView = this.assertGroupView(source);
@@ -581,7 +581,7 @@ let EditorPart = class EditorPart extends Part {
581
581
  const sourceView = this.assertGroupView(group);
582
582
  const targetView = this.assertGroupView(location);
583
583
  if (sourceView.id === targetView.id) {
584
- throw new Error('Cannot move group into its own');
584
+ throw ( new Error('Cannot move group into its own'));
585
585
  }
586
586
  const restoreFocus = this.shouldRestoreFocus(sourceView.element);
587
587
  let movedView;
@@ -623,26 +623,31 @@ let EditorPart = class EditorPart extends Part {
623
623
  editors.push({ editor, options });
624
624
  index++;
625
625
  }
626
+ let result = true;
626
627
  if (options?.mode === 0 ) {
627
628
  sourceView.copyEditors(editors, targetView);
628
629
  }
629
630
  else {
630
- sourceView.moveEditors(editors, targetView);
631
+ result = sourceView.moveEditors(editors, targetView);
631
632
  }
632
633
  if (sourceView.isEmpty && !sourceView.disposed ) {
633
634
  this.removeGroup(sourceView, true);
634
635
  }
635
- return targetView;
636
+ return result;
636
637
  }
637
638
  mergeAllGroups(target) {
638
639
  const targetView = this.assertGroupView(target);
640
+ let result = true;
639
641
  for (const group of this.getGroups(1 )) {
640
642
  if (group === targetView) {
641
643
  continue;
642
644
  }
643
- this.mergeGroup(group, targetView);
645
+ const merged = this.mergeGroup(group, targetView);
646
+ if (!merged) {
647
+ result = false;
648
+ }
644
649
  }
645
- return targetView;
650
+ return result;
646
651
  }
647
652
  assertGroupView(group) {
648
653
  let groupView;
@@ -653,7 +658,7 @@ let EditorPart = class EditorPart extends Part {
653
658
  groupView = group;
654
659
  }
655
660
  if (!groupView) {
656
- throw new Error('Invalid editor group provided!');
661
+ throw ( new Error('Invalid editor group provided!'));
657
662
  }
658
663
  return groupView;
659
664
  }
@@ -952,17 +957,41 @@ let EditorPart = class EditorPart extends Part {
952
957
  mostRecentActiveGroups: this.mostRecentActiveGroups
953
958
  };
954
959
  }
955
- async applyState(state) {
956
- for (const group of this.getGroups(1 )) {
957
- const closed = await group.closeAllEditors();
958
- if (!closed) {
959
- return false;
960
- }
960
+ applyState(state) {
961
+ if (state === 'empty') {
962
+ return this.doApplyEmptyState();
961
963
  }
962
- this.disposeGroups();
964
+ else {
965
+ return this.doApplyState(state);
966
+ }
967
+ }
968
+ async doApplyState(state) {
969
+ const groups = await this.doPrepareApplyState();
970
+ const resumeEvents = this.disposeGroups(true );
963
971
  this.mostRecentActiveGroups = state.mostRecentActiveGroups;
964
- this.doApplyGridState(state.serializedGrid, state.activeGroup);
965
- return true;
972
+ try {
973
+ this.doApplyGridState(state.serializedGrid, state.activeGroup);
974
+ }
975
+ finally {
976
+ resumeEvents();
977
+ }
978
+ await this.activeGroup.openEditors(( groups
979
+ .flatMap(group => group.editors)
980
+ .filter(editor => this.editorPartsView.groups.every(groupView => !groupView.contains(editor)))
981
+ .map(editor => ({
982
+ editor, options: { pinned: true, preserveFocus: true, inactive: true }
983
+ }))));
984
+ }
985
+ async doApplyEmptyState() {
986
+ await this.doPrepareApplyState();
987
+ this.mergeAllGroups(this.activeGroup);
988
+ }
989
+ async doPrepareApplyState() {
990
+ const groups = this.getGroups(1 );
991
+ for (const group of groups) {
992
+ await group.closeAllEditors({ excludeConfirming: true });
993
+ }
994
+ return groups;
966
995
  }
967
996
  doApplyGridState(gridState, activeGroupId, editorGroupViewsToReuse) {
968
997
  this.doCreateGridControlWithState(gridState, activeGroupId, editorGroupViewsToReuse);
@@ -989,13 +1018,19 @@ let EditorPart = class EditorPart extends Part {
989
1018
  type: "workbench.parts.editor"
990
1019
  };
991
1020
  }
992
- disposeGroups() {
1021
+ disposeGroups(surpressEvents) {
1022
+ if (surpressEvents) {
1023
+ this._onDidRemoveGroup.pause();
1024
+ }
993
1025
  for (const group of this.groups) {
994
1026
  group.dispose();
995
1027
  this._onDidRemoveGroup.fire(group);
996
1028
  }
997
1029
  this.groupViews.clear();
998
1030
  this.mostRecentActiveGroups = [];
1031
+ if (surpressEvents) {
1032
+ return () => this._onDidRemoveGroup.resume();
1033
+ }
999
1034
  }
1000
1035
  dispose() {
1001
1036
  this.disposeGroups();