@codingame/monaco-vscode-view-common-service-override 5.3.0 → 6.0.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.
- package/package.json +3 -3
- package/viewCommon.js +1 -1
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +2 -1
- package/vscode/src/vs/base/browser/ui/grid/grid.js +34 -24
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +35 -34
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +9 -60
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +119 -79
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +76 -64
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +51 -71
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +21 -18
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +11 -8
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +8 -7
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +112 -107
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +36 -30
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +75 -69
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +143 -25
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +20 -16
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +13 -11
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +5 -4
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +8 -5
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +9 -6
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +51 -37
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +28 -25
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -13
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +5 -5
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +3 -2
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +2 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +34 -23
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +3 -2
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +7 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +3 -2
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +1 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +17 -15
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +4 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +7 -7
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +9 -8
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +11 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +24 -23
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +3 -2
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +5 -4
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +2 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +26 -23
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -13
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +5 -5
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +7 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +8 -6
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +10 -8
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +3 -2
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +4 -3
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +21 -19
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +73 -63
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +19 -15
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +1 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +23 -18
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +20 -14
- package/vscode/src/vs/base/browser/deviceAccess.js +0 -61
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +0 -13
- package/vscode/src/vs/workbench/browser/window.js +0 -330
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -371
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +0 -188
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { $, getWindow, getActiveElement, isAncestorOfActiveElement, addDisposableGenericMouseDownListener, EventHelper, Dimension } from 'vscode/vscode/vs/base/browser/dom';
|
|
4
|
+
import { $, getWindow, getActiveElement, isAncestorOfActiveElement, isHTMLElement, addDisposableGenericMouseDownListener, EventHelper, Dimension } from 'vscode/vscode/vs/base/browser/dom';
|
|
5
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';
|
|
@@ -14,20 +14,24 @@ import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
|
14
14
|
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
15
15
|
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
16
16
|
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
17
|
+
import { GroupOrientation, GroupsOrder, GroupLocation, GroupsArrangement, GroupDirection, MergeGroupMode } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
17
18
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
18
|
-
import { isGridBranchNode, createSerializedGrid, Sizing, SerializableGrid } from '../../../../base/browser/ui/grid/grid.js';
|
|
19
|
+
import { isGridBranchNode, createSerializedGrid, Sizing, Direction, SerializableGrid } from '../../../../base/browser/ui/grid/grid.js';
|
|
20
|
+
import { GroupModelChangeKind } from 'vscode/vscode/vs/workbench/common/editor';
|
|
19
21
|
import { EDITOR_GROUP_BORDER, EDITOR_PANE_BACKGROUND } from 'vscode/vscode/vs/workbench/common/theme';
|
|
20
22
|
import { coalesce, distinct } from 'vscode/vscode/vs/base/common/arrays';
|
|
21
23
|
import { getEditorPartOptions, impactsEditorPartOptions } from 'vscode/vscode/vs/workbench/browser/parts/editor/editor';
|
|
22
24
|
import { EditorGroupView } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorGroupView';
|
|
23
25
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
24
26
|
import { DisposableStore, toDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
27
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
25
28
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
26
29
|
import { isSerializedEditorGroupModel } from 'vscode/vscode/vs/workbench/common/editor/editorGroupModel';
|
|
27
30
|
import { EditorDropTarget } from './editorDropTarget.js';
|
|
28
31
|
import { Color } from 'vscode/vscode/vs/base/common/color';
|
|
29
32
|
import { CenteredViewLayout } from '../../../../base/browser/ui/centered/centeredViewLayout.js';
|
|
30
33
|
import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
34
|
+
import { Parts, Position } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
31
35
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
32
36
|
import { assertType, assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
33
37
|
import { CompositeDragAndDropObserver } from 'vscode/vscode/vs/workbench/browser/dnd';
|
|
@@ -39,7 +43,9 @@ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/
|
|
|
39
43
|
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
40
44
|
import { IsAuxiliaryEditorPartContext, EditorPartMultipleEditorGroupsContext, EditorPartMaximizedEditorGroupContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
41
45
|
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
46
|
+
import { LayoutPriority } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
42
47
|
import { orthogonal } from '../../../../base/browser/ui/grid/gridview.js';
|
|
48
|
+
import { Orientation } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
43
49
|
|
|
44
50
|
var EditorPart_1;
|
|
45
51
|
class GridWidgetView {
|
|
@@ -115,8 +121,8 @@ let EditorPart = class EditorPart extends Part {
|
|
|
115
121
|
this.onDidScroll = Event.any(this.onDidSetGridWidget.event, this._onDidScroll.event);
|
|
116
122
|
this._onDidChangeEditorPartOptions = this._register(( new Emitter()));
|
|
117
123
|
this.onDidChangeEditorPartOptions = this._onDidChangeEditorPartOptions.event;
|
|
118
|
-
this.workspaceMemento = this.getMemento(
|
|
119
|
-
this.profileMemento = this.getMemento(
|
|
124
|
+
this.workspaceMemento = this.getMemento(StorageScope.WORKSPACE, StorageTarget.USER);
|
|
125
|
+
this.profileMemento = this.getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
|
|
120
126
|
this.groupViews = ( new Map());
|
|
121
127
|
this.mostRecentActiveGroups = [];
|
|
122
128
|
this.gridWidgetDisposables = this._register(( new DisposableStore()));
|
|
@@ -137,13 +143,13 @@ let EditorPart = class EditorPart extends Part {
|
|
|
137
143
|
this.whenRestoredPromise = ( new DeferredPromise());
|
|
138
144
|
this.whenRestored = this.whenRestoredPromise.p;
|
|
139
145
|
this._willRestoreState = false;
|
|
140
|
-
this.priority =
|
|
146
|
+
this.priority = LayoutPriority.High;
|
|
141
147
|
this.registerListeners();
|
|
142
148
|
}
|
|
143
149
|
registerListeners() {
|
|
144
150
|
this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e)));
|
|
145
151
|
this._register(this.themeService.onDidFileIconThemeChange(() => this.handleChangedPartOptions()));
|
|
146
|
-
this._register(this.onDidChangeMementoValue(
|
|
152
|
+
this._register(this.onDidChangeMementoValue(StorageScope.WORKSPACE, this._store)(e => this.onDidChangeMementoState(e)));
|
|
147
153
|
}
|
|
148
154
|
onConfigurationUpdated(event) {
|
|
149
155
|
if (impactsEditorPartOptions(event)) {
|
|
@@ -179,22 +185,22 @@ let EditorPart = class EditorPart extends Part {
|
|
|
179
185
|
return this.groupViews.size;
|
|
180
186
|
}
|
|
181
187
|
get orientation() {
|
|
182
|
-
return (
|
|
188
|
+
return (this.gridWidget && this.gridWidget.orientation === Orientation.VERTICAL) ? GroupOrientation.VERTICAL : GroupOrientation.HORIZONTAL;
|
|
183
189
|
}
|
|
184
190
|
get isReady() { return this._isReady; }
|
|
185
191
|
get hasRestorableState() {
|
|
186
192
|
return !!this.workspaceMemento[EditorPart_1.EDITOR_PART_UI_STATE_STORAGE_KEY];
|
|
187
193
|
}
|
|
188
194
|
get willRestoreState() { return this._willRestoreState; }
|
|
189
|
-
getGroups(order =
|
|
195
|
+
getGroups(order = GroupsOrder.CREATION_TIME) {
|
|
190
196
|
switch (order) {
|
|
191
|
-
case
|
|
197
|
+
case GroupsOrder.CREATION_TIME:
|
|
192
198
|
return this.groups;
|
|
193
|
-
case
|
|
199
|
+
case GroupsOrder.MOST_RECENTLY_ACTIVE: {
|
|
194
200
|
const mostRecentActive = coalesce(( this.mostRecentActiveGroups.map(groupId => this.getGroup(groupId))));
|
|
195
201
|
return distinct([...mostRecentActive, ...this.groups]);
|
|
196
202
|
}
|
|
197
|
-
case
|
|
203
|
+
case GroupsOrder.GRID_APPEARANCE: {
|
|
198
204
|
const views = [];
|
|
199
205
|
if (this.gridWidget) {
|
|
200
206
|
this.fillGridNodes(views, this.gridWidget.getViews());
|
|
@@ -234,24 +240,24 @@ let EditorPart = class EditorPart extends Part {
|
|
|
234
240
|
}
|
|
235
241
|
doFindGroupByLocation(location, source, wrap) {
|
|
236
242
|
const sourceGroupView = this.assertGroupView(source);
|
|
237
|
-
const groups = this.getGroups(
|
|
243
|
+
const groups = this.getGroups(GroupsOrder.GRID_APPEARANCE);
|
|
238
244
|
const index = groups.indexOf(sourceGroupView);
|
|
239
245
|
switch (location) {
|
|
240
|
-
case
|
|
246
|
+
case GroupLocation.FIRST:
|
|
241
247
|
return groups[0];
|
|
242
|
-
case
|
|
248
|
+
case GroupLocation.LAST:
|
|
243
249
|
return groups[groups.length - 1];
|
|
244
|
-
case
|
|
250
|
+
case GroupLocation.NEXT: {
|
|
245
251
|
let nextGroup = groups[index + 1];
|
|
246
252
|
if (!nextGroup && wrap) {
|
|
247
|
-
nextGroup = this.doFindGroupByLocation(
|
|
253
|
+
nextGroup = this.doFindGroupByLocation(GroupLocation.FIRST, source);
|
|
248
254
|
}
|
|
249
255
|
return nextGroup;
|
|
250
256
|
}
|
|
251
|
-
case
|
|
257
|
+
case GroupLocation.PREVIOUS: {
|
|
252
258
|
let previousGroup = groups[index - 1];
|
|
253
259
|
if (!previousGroup && wrap) {
|
|
254
|
-
previousGroup = this.doFindGroupByLocation(
|
|
260
|
+
previousGroup = this.doFindGroupByLocation(GroupLocation.LAST, source);
|
|
255
261
|
}
|
|
256
262
|
return previousGroup;
|
|
257
263
|
}
|
|
@@ -287,17 +293,17 @@ let EditorPart = class EditorPart extends Part {
|
|
|
287
293
|
}
|
|
288
294
|
const groupView = this.assertGroupView(target);
|
|
289
295
|
switch (arrangement) {
|
|
290
|
-
case
|
|
296
|
+
case GroupsArrangement.EVEN:
|
|
291
297
|
this.gridWidget.distributeViewSizes();
|
|
292
298
|
break;
|
|
293
|
-
case
|
|
299
|
+
case GroupsArrangement.MAXIMIZE:
|
|
294
300
|
if (this.groups.length < 2) {
|
|
295
301
|
return;
|
|
296
302
|
}
|
|
297
303
|
this.gridWidget.maximizeView(groupView);
|
|
298
304
|
groupView.focus();
|
|
299
305
|
break;
|
|
300
|
-
case
|
|
306
|
+
case GroupsArrangement.EXPAND:
|
|
301
307
|
this.gridWidget.expandView(groupView);
|
|
302
308
|
break;
|
|
303
309
|
}
|
|
@@ -307,15 +313,15 @@ let EditorPart = class EditorPart extends Part {
|
|
|
307
313
|
this.unmaximizeGroup();
|
|
308
314
|
}
|
|
309
315
|
else {
|
|
310
|
-
this.arrangeGroups(
|
|
316
|
+
this.arrangeGroups(GroupsArrangement.MAXIMIZE, target);
|
|
311
317
|
}
|
|
312
318
|
}
|
|
313
319
|
toggleExpandGroup(target = this.activeGroup) {
|
|
314
320
|
if (this.isGroupExpanded(this.activeGroup)) {
|
|
315
|
-
this.arrangeGroups(
|
|
321
|
+
this.arrangeGroups(GroupsArrangement.EVEN);
|
|
316
322
|
}
|
|
317
323
|
else {
|
|
318
|
-
this.arrangeGroups(
|
|
324
|
+
this.arrangeGroups(GroupsArrangement.EXPAND, target);
|
|
319
325
|
}
|
|
320
326
|
}
|
|
321
327
|
unmaximizeGroup() {
|
|
@@ -335,7 +341,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
335
341
|
if (!this.gridWidget) {
|
|
336
342
|
return;
|
|
337
343
|
}
|
|
338
|
-
const newOrientation = (
|
|
344
|
+
const newOrientation = (orientation === GroupOrientation.HORIZONTAL) ? Orientation.HORIZONTAL : Orientation.VERTICAL;
|
|
339
345
|
if (this.gridWidget.orientation !== newOrientation) {
|
|
340
346
|
this.gridWidget.orientation = newOrientation;
|
|
341
347
|
}
|
|
@@ -354,7 +360,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
354
360
|
}
|
|
355
361
|
}
|
|
356
362
|
countGroups(layout.groups);
|
|
357
|
-
let currentGroupViews = this.getGroups(
|
|
363
|
+
let currentGroupViews = this.getGroups(GroupsOrder.GRID_APPEARANCE);
|
|
358
364
|
if (layoutGroupsCount < currentGroupViews.length) {
|
|
359
365
|
const lastGroupInLayout = currentGroupViews[layoutGroupsCount - 1];
|
|
360
366
|
currentGroupViews.forEach((group, index) => {
|
|
@@ -362,7 +368,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
362
368
|
this.mergeGroup(group, lastGroupInLayout);
|
|
363
369
|
}
|
|
364
370
|
});
|
|
365
|
-
currentGroupViews = this.getGroups(
|
|
371
|
+
currentGroupViews = this.getGroups(GroupsOrder.GRID_APPEARANCE);
|
|
366
372
|
}
|
|
367
373
|
const activeGroup = this.activeGroup;
|
|
368
374
|
const gridDescriptor = createSerializedGrid({
|
|
@@ -379,7 +385,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
379
385
|
}
|
|
380
386
|
getLayout() {
|
|
381
387
|
const serializedGrid = this.gridWidget.serialize();
|
|
382
|
-
const orientation = serializedGrid.orientation ===
|
|
388
|
+
const orientation = serializedGrid.orientation === Orientation.HORIZONTAL ? GroupOrientation.HORIZONTAL : GroupOrientation.VERTICAL;
|
|
383
389
|
const root = this.serializedNodeToGroupLayoutArgument(serializedGrid.root);
|
|
384
390
|
return {
|
|
385
391
|
orientation,
|
|
@@ -424,7 +430,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
424
430
|
this._onDidAddGroup.fire(newGroupView);
|
|
425
431
|
this.notifyGroupIndexChange();
|
|
426
432
|
if (shouldExpand) {
|
|
427
|
-
this.arrangeGroups(
|
|
433
|
+
this.arrangeGroups(GroupsArrangement.EXPAND, newGroupView);
|
|
428
434
|
}
|
|
429
435
|
if (restoreFocus) {
|
|
430
436
|
locationView.focus();
|
|
@@ -445,16 +451,16 @@ let EditorPart = class EditorPart extends Part {
|
|
|
445
451
|
return Sizing.Auto;
|
|
446
452
|
}
|
|
447
453
|
}
|
|
448
|
-
doCreateGroupView(from) {
|
|
454
|
+
doCreateGroupView(from, options) {
|
|
449
455
|
let groupView;
|
|
450
456
|
if (from instanceof EditorGroupView) {
|
|
451
|
-
groupView = EditorGroupView.createCopy(from, this.editorPartsView, this, this.groupsLabel, this.count, this.scopedInstantiationService);
|
|
457
|
+
groupView = EditorGroupView.createCopy(from, this.editorPartsView, this, this.groupsLabel, this.count, this.scopedInstantiationService, options);
|
|
452
458
|
}
|
|
453
459
|
else if (isSerializedEditorGroupModel(from)) {
|
|
454
|
-
groupView = EditorGroupView.createFromSerialized(from, this.editorPartsView, this, this.groupsLabel, this.count, this.scopedInstantiationService);
|
|
460
|
+
groupView = EditorGroupView.createFromSerialized(from, this.editorPartsView, this, this.groupsLabel, this.count, this.scopedInstantiationService, options);
|
|
455
461
|
}
|
|
456
462
|
else {
|
|
457
|
-
groupView = EditorGroupView.createNew(this.editorPartsView, this, this.groupsLabel, this.count, this.scopedInstantiationService);
|
|
463
|
+
groupView = EditorGroupView.createNew(this.editorPartsView, this, this.groupsLabel, this.count, this.scopedInstantiationService, options);
|
|
458
464
|
}
|
|
459
465
|
this.groupViews.set(groupView.id, groupView);
|
|
460
466
|
const groupDisposables = ( new DisposableStore());
|
|
@@ -464,13 +470,13 @@ let EditorPart = class EditorPart extends Part {
|
|
|
464
470
|
}));
|
|
465
471
|
groupDisposables.add(groupView.onDidModelChange(e => {
|
|
466
472
|
switch (e.kind) {
|
|
467
|
-
case
|
|
473
|
+
case GroupModelChangeKind.GROUP_LOCKED:
|
|
468
474
|
this._onDidChangeGroupLocked.fire(groupView);
|
|
469
475
|
break;
|
|
470
|
-
case
|
|
476
|
+
case GroupModelChangeKind.GROUP_INDEX:
|
|
471
477
|
this._onDidChangeGroupIndex.fire(groupView);
|
|
472
478
|
break;
|
|
473
|
-
case
|
|
479
|
+
case GroupModelChangeKind.GROUP_LABEL:
|
|
474
480
|
this._onDidChangeGroupLabel.fire(groupView);
|
|
475
481
|
break;
|
|
476
482
|
}
|
|
@@ -509,7 +515,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
509
515
|
try {
|
|
510
516
|
const viewSize = this.gridWidget.getViewSize(group);
|
|
511
517
|
if (viewSize.width === group.minimumWidth || viewSize.height === group.minimumHeight) {
|
|
512
|
-
this.arrangeGroups(
|
|
518
|
+
this.arrangeGroups(GroupsArrangement.EXPAND, group);
|
|
513
519
|
}
|
|
514
520
|
}
|
|
515
521
|
catch (error) {
|
|
@@ -526,15 +532,15 @@ let EditorPart = class EditorPart extends Part {
|
|
|
526
532
|
}
|
|
527
533
|
toGridViewDirection(direction) {
|
|
528
534
|
switch (direction) {
|
|
529
|
-
case
|
|
530
|
-
case
|
|
531
|
-
case
|
|
532
|
-
case
|
|
535
|
+
case GroupDirection.UP: return Direction.Up;
|
|
536
|
+
case GroupDirection.DOWN: return Direction.Down;
|
|
537
|
+
case GroupDirection.LEFT: return Direction.Left;
|
|
538
|
+
case GroupDirection.RIGHT: return Direction.Right;
|
|
533
539
|
}
|
|
534
540
|
}
|
|
535
541
|
toGridViewOrientation(orientation, fallback) {
|
|
536
542
|
if (typeof orientation === 'number') {
|
|
537
|
-
return orientation ===
|
|
543
|
+
return orientation === GroupOrientation.HORIZONTAL ? Orientation.HORIZONTAL : Orientation.VERTICAL;
|
|
538
544
|
}
|
|
539
545
|
return fallback;
|
|
540
546
|
}
|
|
@@ -551,7 +557,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
551
557
|
}
|
|
552
558
|
}
|
|
553
559
|
doRemoveGroupWithEditors(groupView) {
|
|
554
|
-
const mostRecentlyActiveGroups = this.getGroups(
|
|
560
|
+
const mostRecentlyActiveGroups = this.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE);
|
|
555
561
|
let lastActiveGroup;
|
|
556
562
|
if (this._activeGroup === groupView) {
|
|
557
563
|
lastActiveGroup = mostRecentlyActiveGroups[1];
|
|
@@ -564,7 +570,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
564
570
|
doRemoveEmptyGroup(groupView, preserveFocus) {
|
|
565
571
|
const restoreFocus = !preserveFocus && this.shouldRestoreFocus(this.container);
|
|
566
572
|
if (this._activeGroup === groupView) {
|
|
567
|
-
const mostRecentlyActiveGroups = this.getGroups(
|
|
573
|
+
const mostRecentlyActiveGroups = this.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE);
|
|
568
574
|
const nextActiveGroup = mostRecentlyActiveGroups[1];
|
|
569
575
|
this.doSetGroupActive(nextActiveGroup);
|
|
570
576
|
}
|
|
@@ -624,7 +630,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
624
630
|
index++;
|
|
625
631
|
}
|
|
626
632
|
let result = true;
|
|
627
|
-
if (options?.mode ===
|
|
633
|
+
if (options?.mode === MergeGroupMode.COPY_EDITORS) {
|
|
628
634
|
sourceView.copyEditors(editors, targetView);
|
|
629
635
|
}
|
|
630
636
|
else {
|
|
@@ -638,7 +644,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
638
644
|
mergeAllGroups(target) {
|
|
639
645
|
const targetView = this.assertGroupView(target);
|
|
640
646
|
let result = true;
|
|
641
|
-
for (const group of this.getGroups(
|
|
647
|
+
for (const group of this.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE)) {
|
|
642
648
|
if (group === targetView) {
|
|
643
649
|
continue;
|
|
644
650
|
}
|
|
@@ -663,7 +669,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
663
669
|
return groupView;
|
|
664
670
|
}
|
|
665
671
|
createEditorDropTarget(container, delegate) {
|
|
666
|
-
assertType(container
|
|
672
|
+
assertType(isHTMLElement(container));
|
|
667
673
|
return this.scopedInstantiationService.createInstance(EditorDropTarget, container, delegate);
|
|
668
674
|
}
|
|
669
675
|
get minimumWidth() { return Math.min(this.centeredLayoutWidget.minimumWidth, this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(getWindow(this.container))).width); }
|
|
@@ -691,7 +697,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
691
697
|
}
|
|
692
698
|
parent.appendChild(this.container);
|
|
693
699
|
const scopedContextKeyService = this._register(this.contextKeyService.createScoped(this.container));
|
|
694
|
-
this.scopedInstantiationService = this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, scopedContextKeyService])));
|
|
700
|
+
this.scopedInstantiationService = this._register(this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, scopedContextKeyService]))));
|
|
695
701
|
this._willRestoreState = !options || options.restorePreviousState;
|
|
696
702
|
this.doCreateGridControl();
|
|
697
703
|
this.centeredLayoutWidget = this._register(( new CenteredViewLayout(
|
|
@@ -750,11 +756,11 @@ let EditorPart = class EditorPart extends Part {
|
|
|
750
756
|
let lastOpenHorizontalPosition;
|
|
751
757
|
let lastOpenVerticalPosition;
|
|
752
758
|
const openPartAtPosition = (position) => {
|
|
753
|
-
if (!this.layoutService.isVisible(
|
|
754
|
-
this.layoutService.setPartHidden(false,
|
|
759
|
+
if (!this.layoutService.isVisible(Parts.PANEL_PART) && position === this.layoutService.getPanelPosition()) {
|
|
760
|
+
this.layoutService.setPartHidden(false, Parts.PANEL_PART);
|
|
755
761
|
}
|
|
756
|
-
else if (!this.layoutService.isVisible(
|
|
757
|
-
this.layoutService.setPartHidden(false,
|
|
762
|
+
else if (!this.layoutService.isVisible(Parts.AUXILIARYBAR_PART) && position === (this.layoutService.getSideBarPosition() === Position.RIGHT ? Position.LEFT : Position.RIGHT)) {
|
|
763
|
+
this.layoutService.setPartHidden(false, Parts.AUXILIARYBAR_PART);
|
|
758
764
|
}
|
|
759
765
|
};
|
|
760
766
|
const clearAllTimeouts = () => {
|
|
@@ -778,13 +784,13 @@ let EditorPart = class EditorPart extends Part {
|
|
|
778
784
|
let openVerticalPosition = undefined;
|
|
779
785
|
const proximity = 100;
|
|
780
786
|
if (e.eventData.clientX < boundingRect.left + proximity) {
|
|
781
|
-
openHorizontalPosition =
|
|
787
|
+
openHorizontalPosition = Position.LEFT;
|
|
782
788
|
}
|
|
783
789
|
if (e.eventData.clientX > boundingRect.right - proximity) {
|
|
784
|
-
openHorizontalPosition =
|
|
790
|
+
openHorizontalPosition = Position.RIGHT;
|
|
785
791
|
}
|
|
786
792
|
if (e.eventData.clientY > boundingRect.bottom - proximity) {
|
|
787
|
-
openVerticalPosition =
|
|
793
|
+
openVerticalPosition = Position.BOTTOM;
|
|
788
794
|
}
|
|
789
795
|
if (horizontalOpenerTimeout && openHorizontalPosition !== lastOpenHorizontalPosition) {
|
|
790
796
|
clearTimeout(horizontalOpenerTimeout);
|
|
@@ -848,7 +854,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
848
854
|
}
|
|
849
855
|
return true;
|
|
850
856
|
}
|
|
851
|
-
doCreateGridControlWithState(serializedGrid, activeGroupId, editorGroupViewsToReuse) {
|
|
857
|
+
doCreateGridControlWithState(serializedGrid, activeGroupId, editorGroupViewsToReuse, options) {
|
|
852
858
|
let reuseGroupViews;
|
|
853
859
|
if (editorGroupViewsToReuse) {
|
|
854
860
|
reuseGroupViews = editorGroupViewsToReuse.slice(0);
|
|
@@ -864,7 +870,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
864
870
|
groupView = reuseGroupViews.shift();
|
|
865
871
|
}
|
|
866
872
|
else {
|
|
867
|
-
groupView = this.doCreateGroupView(serializedEditorGroup);
|
|
873
|
+
groupView = this.doCreateGroupView(serializedEditorGroup, options);
|
|
868
874
|
}
|
|
869
875
|
groupViews.push(groupView);
|
|
870
876
|
if (groupView.id === activeGroupId) {
|
|
@@ -902,7 +908,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
902
908
|
container.classList.toggle('empty', this.isEmpty);
|
|
903
909
|
}
|
|
904
910
|
notifyGroupIndexChange() {
|
|
905
|
-
this.getGroups(
|
|
911
|
+
this.getGroups(GroupsOrder.GRID_APPEARANCE).forEach((group, index) => group.notifyIndexChanged(index));
|
|
906
912
|
}
|
|
907
913
|
notifyGroupsLabelChange(newLabel) {
|
|
908
914
|
for (const group of this.groups) {
|
|
@@ -957,20 +963,20 @@ let EditorPart = class EditorPart extends Part {
|
|
|
957
963
|
mostRecentActiveGroups: this.mostRecentActiveGroups
|
|
958
964
|
};
|
|
959
965
|
}
|
|
960
|
-
applyState(state) {
|
|
966
|
+
applyState(state, options) {
|
|
961
967
|
if (state === 'empty') {
|
|
962
968
|
return this.doApplyEmptyState();
|
|
963
969
|
}
|
|
964
970
|
else {
|
|
965
|
-
return this.doApplyState(state);
|
|
971
|
+
return this.doApplyState(state, options);
|
|
966
972
|
}
|
|
967
973
|
}
|
|
968
|
-
async doApplyState(state) {
|
|
974
|
+
async doApplyState(state, options) {
|
|
969
975
|
const groups = await this.doPrepareApplyState();
|
|
970
976
|
const resumeEvents = this.disposeGroups(true );
|
|
971
977
|
this.mostRecentActiveGroups = state.mostRecentActiveGroups;
|
|
972
978
|
try {
|
|
973
|
-
this.doApplyGridState(state.serializedGrid, state.activeGroup);
|
|
979
|
+
this.doApplyGridState(state.serializedGrid, state.activeGroup, undefined, options);
|
|
974
980
|
}
|
|
975
981
|
finally {
|
|
976
982
|
resumeEvents();
|
|
@@ -987,17 +993,17 @@ let EditorPart = class EditorPart extends Part {
|
|
|
987
993
|
this.mergeAllGroups(this.activeGroup);
|
|
988
994
|
}
|
|
989
995
|
async doPrepareApplyState() {
|
|
990
|
-
const groups = this.getGroups(
|
|
996
|
+
const groups = this.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE);
|
|
991
997
|
for (const group of groups) {
|
|
992
998
|
await group.closeAllEditors({ excludeConfirming: true });
|
|
993
999
|
}
|
|
994
1000
|
return groups;
|
|
995
1001
|
}
|
|
996
|
-
doApplyGridState(gridState, activeGroupId, editorGroupViewsToReuse) {
|
|
997
|
-
this.doCreateGridControlWithState(gridState, activeGroupId, editorGroupViewsToReuse);
|
|
1002
|
+
doApplyGridState(gridState, activeGroupId, editorGroupViewsToReuse, options) {
|
|
1003
|
+
this.doCreateGridControlWithState(gridState, activeGroupId, editorGroupViewsToReuse, options);
|
|
998
1004
|
this.doLayout(this._contentDimension);
|
|
999
1005
|
this.updateContainer();
|
|
1000
|
-
for (const groupView of this.getGroups(
|
|
1006
|
+
for (const groupView of this.getGroups(GroupsOrder.GRID_APPEARANCE)) {
|
|
1001
1007
|
if (!editorGroupViewsToReuse?.includes(groupView)) {
|
|
1002
1008
|
this._onDidAddGroup.fire(groupView);
|
|
1003
1009
|
}
|
|
@@ -1005,7 +1011,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
1005
1011
|
this.notifyGroupIndexChange();
|
|
1006
1012
|
}
|
|
1007
1013
|
onDidChangeMementoState(e) {
|
|
1008
|
-
if (e.external && e.scope ===
|
|
1014
|
+
if (e.external && e.scope === StorageScope.WORKSPACE) {
|
|
1009
1015
|
this.reloadMemento(e.scope);
|
|
1010
1016
|
const state = this.loadState();
|
|
1011
1017
|
if (state) {
|
|
@@ -1015,7 +1021,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
1015
1021
|
}
|
|
1016
1022
|
toJSON() {
|
|
1017
1023
|
return {
|
|
1018
|
-
type:
|
|
1024
|
+
type: Parts.EDITOR_PART
|
|
1019
1025
|
};
|
|
1020
1026
|
}
|
|
1021
1027
|
disposeGroups(surpressEvents) {
|
|
@@ -1049,7 +1055,7 @@ EditorPart = EditorPart_1 = ( __decorate([
|
|
|
1049
1055
|
], EditorPart));
|
|
1050
1056
|
let MainEditorPart = class MainEditorPart extends EditorPart {
|
|
1051
1057
|
constructor(editorPartsView, instantiationService, themeService, configurationService, storageService, layoutService, hostService, contextKeyService) {
|
|
1052
|
-
super(editorPartsView,
|
|
1058
|
+
super(editorPartsView, Parts.EDITOR_PART, '', mainWindow.vscodeWindowId, instantiationService, themeService, configurationService, storageService, layoutService, hostService, contextKeyService);
|
|
1053
1059
|
}
|
|
1054
1060
|
};
|
|
1055
1061
|
MainEditorPart = ( __decorate([
|