@codingame/monaco-vscode-views-service-override 2.0.3 → 2.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.
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +11 -11
- package/tools/editor.js +14 -0
- package/views.js +12 -5
- package/vscode/src/vs/base/common/codicons.d.ts +5 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +2 -2
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +160 -4
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +14 -19
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +59 -21
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +77 -45
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +23 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +77 -45
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +131 -5
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +1 -3
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +8 -16
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +8 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +4 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +3 -4
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +17 -16
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +1 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +2 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +2 -1
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +18 -4
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +2 -2
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +15 -4
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +2 -2
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +6 -2
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.css.js +0 -6
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.js +0 -290
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +0 -801
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +0 -142
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +0 -412
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +0 -1315
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +0 -186
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +0 -346
- package/vscode/src/vs/workbench/browser/parts/editor/editorTitleControl.js +0 -154
- package/vscode/src/vs/workbench/browser/parts/editor/media/breadcrumbscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortitlecontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/singleeditortabscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +0 -1623
- package/vscode/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.js +0 -152
- package/vscode/src/vs/workbench/browser/parts/editor/noEditorTabsControl.js +0 -54
- package/vscode/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.js +0 -259
- package/vscode/src/vs/workbench/common/editor/filteredEditorGroupModel.js +0 -109
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.js +0 -195
- package/vscode/src/vs/workbench/services/hover/browser/hoverWidget.js +0 -528
- package/vscode/src/vs/workbench/services/hover/browser/media/hover.css.js +0 -6
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
3
3
|
import { Part } from 'vscode/vscode/vs/workbench/browser/part';
|
|
4
|
-
import { getWindow,
|
|
4
|
+
import { getWindow, getActiveElement, isAncestorOfActiveElement, addDisposableGenericMouseDownListener, EventHelper, Dimension, $ } from 'vscode/vscode/vs/base/browser/dom';
|
|
5
5
|
import { Emitter, Relay, Event } from 'vscode/vscode/vs/base/common/event';
|
|
6
6
|
import { contrastBorder, editorBackground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
7
7
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
8
|
import { isGridBranchNode, createSerializedGrid, Sizing, SerializableGrid } from '../../../../base/browser/ui/grid/grid.js';
|
|
9
9
|
import { EDITOR_GROUP_BORDER, EDITOR_PANE_BACKGROUND } from 'vscode/vscode/vs/workbench/common/theme';
|
|
10
|
-
import { coalesce, distinct
|
|
10
|
+
import { coalesce, distinct } from 'vscode/vscode/vs/base/common/arrays';
|
|
11
11
|
import { getEditorPartOptions, impactsEditorPartOptions } from 'vscode/vscode/vs/workbench/browser/parts/editor/editor';
|
|
12
|
-
import { EditorGroupView } from '
|
|
12
|
+
import { EditorGroupView } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorGroupView';
|
|
13
13
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
14
14
|
import { DisposableStore, toDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
15
15
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
@@ -28,6 +28,7 @@ import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/h
|
|
|
28
28
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
29
29
|
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
30
30
|
import { IsAuxiliaryEditorPartContext, EditorPartMultipleEditorGroupsContext, EditorPartMaximizedEditorGroupContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
31
|
+
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
31
32
|
import { orthogonal } from '../../../../base/browser/ui/grid/gridview.js';
|
|
32
33
|
|
|
33
34
|
var EditorPart_1;
|
|
@@ -66,11 +67,11 @@ let EditorPart = class EditorPart extends Part {
|
|
|
66
67
|
static { EditorPart_1 = this; }
|
|
67
68
|
static { this.EDITOR_PART_UI_STATE_STORAGE_KEY = 'editorpart.state'; }
|
|
68
69
|
static { this.EDITOR_PART_CENTERED_VIEW_STORAGE_KEY = 'editorpart.centeredview'; }
|
|
69
|
-
constructor(editorPartsView, id, groupsLabel,
|
|
70
|
+
constructor(editorPartsView, id, groupsLabel, windowId, instantiationService, themeService, configurationService, storageService, layoutService, hostService, contextKeyService) {
|
|
70
71
|
super(id, { hasTitle: false }, themeService, storageService, layoutService);
|
|
71
72
|
this.editorPartsView = editorPartsView;
|
|
72
73
|
this.groupsLabel = groupsLabel;
|
|
73
|
-
this.
|
|
74
|
+
this.windowId = windowId;
|
|
74
75
|
this.instantiationService = instantiationService;
|
|
75
76
|
this.configurationService = configurationService;
|
|
76
77
|
this.hostService = hostService;
|
|
@@ -104,7 +105,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
104
105
|
this.onDidScroll = Event.any(this.onDidSetGridWidget.event, this._onDidScroll.event);
|
|
105
106
|
this._onDidChangeEditorPartOptions = this._register(( new Emitter()));
|
|
106
107
|
this.onDidChangeEditorPartOptions = this._onDidChangeEditorPartOptions.event;
|
|
107
|
-
this.workspaceMemento = this.getMemento(1 ,
|
|
108
|
+
this.workspaceMemento = this.getMemento(1 , 0 );
|
|
108
109
|
this.profileMemento = this.getMemento(0 , 1 );
|
|
109
110
|
this.groupViews = ( new Map());
|
|
110
111
|
this.mostRecentActiveGroups = [];
|
|
@@ -125,12 +126,14 @@ let EditorPart = class EditorPart extends Part {
|
|
|
125
126
|
this.whenReady = this.whenReadyPromise.p;
|
|
126
127
|
this.whenRestoredPromise = ( new DeferredPromise());
|
|
127
128
|
this.whenRestored = this.whenRestoredPromise.p;
|
|
129
|
+
this._willRestoreState = false;
|
|
128
130
|
this.priority = 2 ;
|
|
129
131
|
this.registerListeners();
|
|
130
132
|
}
|
|
131
133
|
registerListeners() {
|
|
132
134
|
this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e)));
|
|
133
135
|
this._register(this.themeService.onDidFileIconThemeChange(() => this.handleChangedPartOptions()));
|
|
136
|
+
this._register(this.onDidChangeMementoValue(1 , this._store)(e => this.onDidChangeMementoState(e)));
|
|
134
137
|
}
|
|
135
138
|
onConfigurationUpdated(event) {
|
|
136
139
|
if (impactsEditorPartOptions(event)) {
|
|
@@ -172,6 +175,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
172
175
|
get hasRestorableState() {
|
|
173
176
|
return !!this.workspaceMemento[EditorPart_1.EDITOR_PART_UI_STATE_STORAGE_KEY];
|
|
174
177
|
}
|
|
178
|
+
get willRestoreState() { return this._willRestoreState; }
|
|
175
179
|
getGroups(order = 0 ) {
|
|
176
180
|
switch (order) {
|
|
177
181
|
case 0 :
|
|
@@ -358,15 +362,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
358
362
|
),
|
|
359
363
|
groups: layout.groups
|
|
360
364
|
});
|
|
361
|
-
this.
|
|
362
|
-
this.doLayout(this._contentDimension);
|
|
363
|
-
this.updateContainer();
|
|
364
|
-
for (const groupView of this.getGroups(2 )) {
|
|
365
|
-
if (!currentGroupViews.includes(groupView)) {
|
|
366
|
-
this._onDidAddGroup.fire(groupView);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
this.notifyGroupIndexChange();
|
|
365
|
+
this.doApplyGridState(gridDescriptor, activeGroup.id, currentGroupViews);
|
|
370
366
|
if (restoreFocus) {
|
|
371
367
|
this._activeGroup.focus();
|
|
372
368
|
}
|
|
@@ -393,11 +389,11 @@ let EditorPart = class EditorPart extends Part {
|
|
|
393
389
|
if (!target) {
|
|
394
390
|
return false;
|
|
395
391
|
}
|
|
396
|
-
const activeElement =
|
|
392
|
+
const activeElement = getActiveElement();
|
|
397
393
|
if (activeElement === target.ownerDocument.body) {
|
|
398
394
|
return true;
|
|
399
395
|
}
|
|
400
|
-
return
|
|
396
|
+
return isAncestorOfActiveElement(target);
|
|
401
397
|
}
|
|
402
398
|
isTwoDimensionalGrid() {
|
|
403
399
|
const views = this.gridWidget.getViews();
|
|
@@ -494,15 +490,20 @@ let EditorPart = class EditorPart extends Part {
|
|
|
494
490
|
this._onDidActivateGroup.fire(group);
|
|
495
491
|
}
|
|
496
492
|
doRestoreGroup(group) {
|
|
497
|
-
if (this.gridWidget) {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
493
|
+
if (!this.gridWidget) {
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
if (this.hasMaximizedGroup() && !this.isGroupMaximized(group)) {
|
|
497
|
+
this.unmaximizeGroup();
|
|
498
|
+
}
|
|
499
|
+
try {
|
|
501
500
|
const viewSize = this.gridWidget.getViewSize(group);
|
|
502
501
|
if (viewSize.width === group.minimumWidth || viewSize.height === group.minimumHeight) {
|
|
503
502
|
this.arrangeGroups(1 , group);
|
|
504
503
|
}
|
|
505
504
|
}
|
|
505
|
+
catch (error) {
|
|
506
|
+
}
|
|
506
507
|
}
|
|
507
508
|
doUpdateMostRecentActive(group, makeMostRecentlyActive) {
|
|
508
509
|
const index = this.mostRecentActiveGroups.indexOf(group.id);
|
|
@@ -564,9 +565,6 @@ let EditorPart = class EditorPart extends Part {
|
|
|
564
565
|
}
|
|
565
566
|
this.notifyGroupIndexChange();
|
|
566
567
|
this.updateContainer();
|
|
567
|
-
if (this.count === 1 && !this.isAuxiliary) {
|
|
568
|
-
firstOrDefault(this.groups)?.lock(false);
|
|
569
|
-
}
|
|
570
568
|
this._onDidRemoveGroup.fire(groupView);
|
|
571
569
|
}
|
|
572
570
|
moveGroup(group, location, direction) {
|
|
@@ -673,13 +671,14 @@ let EditorPart = class EditorPart extends Part {
|
|
|
673
671
|
this.element = parent;
|
|
674
672
|
this.container = document.createElement('div');
|
|
675
673
|
this.container.classList.add('content');
|
|
676
|
-
if (this.
|
|
674
|
+
if (this.windowId !== mainWindow.vscodeWindowId) {
|
|
677
675
|
this.container.classList.add('auxiliary');
|
|
678
676
|
}
|
|
679
677
|
parent.appendChild(this.container);
|
|
680
678
|
const scopedContextKeyService = this._register(this.contextKeyService.createScoped(this.container));
|
|
681
679
|
this.scopedInstantiationService = this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, scopedContextKeyService])));
|
|
682
|
-
this.
|
|
680
|
+
this._willRestoreState = !options || options.restorePreviousState;
|
|
681
|
+
this.doCreateGridControl();
|
|
683
682
|
this.centeredLayoutWidget = this._register(( new CenteredViewLayout(
|
|
684
683
|
this.container,
|
|
685
684
|
this.gridWidgetView,
|
|
@@ -698,7 +697,7 @@ let EditorPart = class EditorPart extends Part {
|
|
|
698
697
|
}
|
|
699
698
|
handleContextKeys(contextKeyService) {
|
|
700
699
|
const isAuxiliaryEditorPartContext = IsAuxiliaryEditorPartContext.bindTo(contextKeyService);
|
|
701
|
-
isAuxiliaryEditorPartContext.set(this.
|
|
700
|
+
isAuxiliaryEditorPartContext.set(this.windowId !== mainWindow.vscodeWindowId);
|
|
702
701
|
const multipleEditorGroupsContext = EditorPartMultipleEditorGroupsContext.bindTo(contextKeyService);
|
|
703
702
|
const maximizedEditorGroupContext = EditorPartMaximizedEditorGroupContext.bindTo(contextKeyService);
|
|
704
703
|
const updateContextKeys = () => {
|
|
@@ -795,9 +794,6 @@ let EditorPart = class EditorPart extends Part {
|
|
|
795
794
|
}));
|
|
796
795
|
}
|
|
797
796
|
centerLayout(active) {
|
|
798
|
-
if (this.hasMaximizedGroup()) {
|
|
799
|
-
this.unmaximizeGroup();
|
|
800
|
-
}
|
|
801
797
|
this.centeredLayoutWidget.activate(active);
|
|
802
798
|
this._activeGroup.focus();
|
|
803
799
|
}
|
|
@@ -807,9 +803,9 @@ let EditorPart = class EditorPart extends Part {
|
|
|
807
803
|
}
|
|
808
804
|
return false;
|
|
809
805
|
}
|
|
810
|
-
doCreateGridControl(
|
|
806
|
+
doCreateGridControl() {
|
|
811
807
|
let restoreError = false;
|
|
812
|
-
if (
|
|
808
|
+
if (this._willRestoreState) {
|
|
813
809
|
restoreError = !this.doCreateGridControlWithPreviousState();
|
|
814
810
|
}
|
|
815
811
|
if (!this.gridWidget || restoreError) {
|
|
@@ -821,16 +817,15 @@ let EditorPart = class EditorPart extends Part {
|
|
|
821
817
|
this.notifyGroupIndexChange();
|
|
822
818
|
}
|
|
823
819
|
doCreateGridControlWithPreviousState() {
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
820
|
+
const state = this.loadState();
|
|
821
|
+
if (state?.serializedGrid) {
|
|
826
822
|
try {
|
|
827
|
-
this.mostRecentActiveGroups =
|
|
828
|
-
this.doCreateGridControlWithState(
|
|
829
|
-
this._activeGroup.focus();
|
|
823
|
+
this.mostRecentActiveGroups = state.mostRecentActiveGroups;
|
|
824
|
+
this.doCreateGridControlWithState(state.serializedGrid, state.activeGroup);
|
|
830
825
|
}
|
|
831
826
|
catch (error) {
|
|
832
827
|
onUnexpectedError(( new Error(
|
|
833
|
-
`Error restoring editor grid widget: ${error} (with state: ${JSON.stringify(
|
|
828
|
+
`Error restoring editor grid widget: ${error} (with state: ${JSON.stringify(state)})`
|
|
834
829
|
)));
|
|
835
830
|
this.disposeGroups();
|
|
836
831
|
return false;
|
|
@@ -919,16 +914,11 @@ let EditorPart = class EditorPart extends Part {
|
|
|
919
914
|
}
|
|
920
915
|
saveState() {
|
|
921
916
|
if (this.gridWidget) {
|
|
922
|
-
const uiState = {
|
|
923
|
-
serializedGrid: this.gridWidget.serialize(),
|
|
924
|
-
activeGroup: this._activeGroup.id,
|
|
925
|
-
mostRecentActiveGroups: this.mostRecentActiveGroups
|
|
926
|
-
};
|
|
927
917
|
if (this.isEmpty) {
|
|
928
918
|
delete this.workspaceMemento[EditorPart_1.EDITOR_PART_UI_STATE_STORAGE_KEY];
|
|
929
919
|
}
|
|
930
920
|
else {
|
|
931
|
-
this.workspaceMemento[EditorPart_1.EDITOR_PART_UI_STATE_STORAGE_KEY] =
|
|
921
|
+
this.workspaceMemento[EditorPart_1.EDITOR_PART_UI_STATE_STORAGE_KEY] = this.createState();
|
|
932
922
|
}
|
|
933
923
|
}
|
|
934
924
|
if (this.centeredLayoutWidget) {
|
|
@@ -942,6 +932,48 @@ let EditorPart = class EditorPart extends Part {
|
|
|
942
932
|
}
|
|
943
933
|
super.saveState();
|
|
944
934
|
}
|
|
935
|
+
loadState() {
|
|
936
|
+
return this.workspaceMemento[EditorPart_1.EDITOR_PART_UI_STATE_STORAGE_KEY];
|
|
937
|
+
}
|
|
938
|
+
createState() {
|
|
939
|
+
return {
|
|
940
|
+
serializedGrid: this.gridWidget.serialize(),
|
|
941
|
+
activeGroup: this._activeGroup.id,
|
|
942
|
+
mostRecentActiveGroups: this.mostRecentActiveGroups
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
async applyState(state) {
|
|
946
|
+
for (const group of this.getGroups(1 )) {
|
|
947
|
+
const closed = await group.closeAllEditors();
|
|
948
|
+
if (!closed) {
|
|
949
|
+
return false;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
this.disposeGroups();
|
|
953
|
+
this.mostRecentActiveGroups = state.mostRecentActiveGroups;
|
|
954
|
+
this.doApplyGridState(state.serializedGrid, state.activeGroup);
|
|
955
|
+
return true;
|
|
956
|
+
}
|
|
957
|
+
doApplyGridState(gridState, activeGroupId, editorGroupViewsToReuse) {
|
|
958
|
+
this.doCreateGridControlWithState(gridState, activeGroupId, editorGroupViewsToReuse);
|
|
959
|
+
this.doLayout(this._contentDimension);
|
|
960
|
+
this.updateContainer();
|
|
961
|
+
for (const groupView of this.getGroups(2 )) {
|
|
962
|
+
if (!editorGroupViewsToReuse?.includes(groupView)) {
|
|
963
|
+
this._onDidAddGroup.fire(groupView);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
this.notifyGroupIndexChange();
|
|
967
|
+
}
|
|
968
|
+
onDidChangeMementoState(e) {
|
|
969
|
+
if (e.external && e.scope === 1 ) {
|
|
970
|
+
this.reloadMemento(e.scope);
|
|
971
|
+
const state = this.loadState();
|
|
972
|
+
if (state) {
|
|
973
|
+
this.applyState(state);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
945
977
|
toJSON() {
|
|
946
978
|
return {
|
|
947
979
|
type: "workbench.parts.editor"
|
|
@@ -972,7 +1004,7 @@ EditorPart = EditorPart_1 = ( __decorate([
|
|
|
972
1004
|
], EditorPart));
|
|
973
1005
|
let MainEditorPart = class MainEditorPart extends EditorPart {
|
|
974
1006
|
constructor(editorPartsView, instantiationService, themeService, configurationService, storageService, layoutService, hostService, contextKeyService) {
|
|
975
|
-
super(editorPartsView, "workbench.parts.editor" , '',
|
|
1007
|
+
super(editorPartsView, "workbench.parts.editor" , '', mainWindow.vscodeWindowId, instantiationService, themeService, configurationService, storageService, layoutService, hostService, contextKeyService);
|
|
976
1008
|
}
|
|
977
1009
|
};
|
|
978
1010
|
MainEditorPart = ( __decorate([
|
|
@@ -4,18 +4,31 @@ import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
|
4
4
|
import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { MainEditorPart } from './editorPart.js';
|
|
6
6
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
|
-
import { distinct } from 'vscode/vscode/vs/base/common/arrays';
|
|
7
|
+
import { firstOrDefault, distinct } from 'vscode/vscode/vs/base/common/arrays';
|
|
8
8
|
import { AuxiliaryEditorPart } from './auxiliaryEditorPart.js';
|
|
9
9
|
import { MultiWindowParts } from 'vscode/vscode/vs/workbench/browser/part';
|
|
10
|
+
import { DeferredPromise } from 'vscode/vscode/vs/base/common/async';
|
|
11
|
+
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
12
|
+
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
13
|
+
import { getWindow } from 'vscode/vscode/vs/base/browser/dom';
|
|
14
|
+
import { getZoomLevel } from 'vscode/vscode/vs/base/browser/browser';
|
|
10
15
|
|
|
16
|
+
var EditorParts_1;
|
|
11
17
|
let EditorParts = class EditorParts extends MultiWindowParts {
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
static { EditorParts_1 = this; }
|
|
19
|
+
constructor(instantiationService, storageService, themeService) {
|
|
20
|
+
super('workbench.editorParts', themeService, storageService);
|
|
14
21
|
this.instantiationService = instantiationService;
|
|
15
22
|
this.mainPart = this._register(this.createMainEditorPart());
|
|
16
23
|
this.mostRecentActiveParts = [this.mainPart];
|
|
17
24
|
this._onDidCreateAuxiliaryEditorPart = this._register(( new Emitter()));
|
|
18
25
|
this.onDidCreateAuxiliaryEditorPart = this._onDidCreateAuxiliaryEditorPart.event;
|
|
26
|
+
this.workspaceMemento = this.getMemento(1 , 0 );
|
|
27
|
+
this._isReady = false;
|
|
28
|
+
this.whenReadyPromise = ( new DeferredPromise());
|
|
29
|
+
this.whenReady = this.whenReadyPromise.p;
|
|
30
|
+
this.whenRestoredPromise = ( new DeferredPromise());
|
|
31
|
+
this.whenRestored = this.whenRestoredPromise.p;
|
|
19
32
|
this._onDidActiveGroupChange = this._register(( new Emitter()));
|
|
20
33
|
this.onDidChangeActiveGroup = this._onDidActiveGroupChange.event;
|
|
21
34
|
this._onDidAddGroup = this._register(( new Emitter()));
|
|
@@ -33,6 +46,11 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
33
46
|
this._onDidChangeGroupMaximized = this._register(( new Emitter()));
|
|
34
47
|
this.onDidChangeGroupMaximized = this._onDidChangeGroupMaximized.event;
|
|
35
48
|
this._register(this.registerPart(this.mainPart));
|
|
49
|
+
this.restoreParts();
|
|
50
|
+
this.registerListeners();
|
|
51
|
+
}
|
|
52
|
+
registerListeners() {
|
|
53
|
+
this._register(this.onDidChangeMementoValue(1 , this._store)(e => this.onDidChangeMementoState(e)));
|
|
36
54
|
}
|
|
37
55
|
createMainEditorPart() {
|
|
38
56
|
return this.instantiationService.createInstance(MainEditorPart, this);
|
|
@@ -117,6 +135,112 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
117
135
|
}
|
|
118
136
|
return this.mainPart;
|
|
119
137
|
}
|
|
138
|
+
static { this.EDITOR_PARTS_UI_STATE_STORAGE_KEY = 'editorparts.state'; }
|
|
139
|
+
get isReady() { return this._isReady; }
|
|
140
|
+
async restoreParts() {
|
|
141
|
+
await this.mainPart.whenReady;
|
|
142
|
+
if (this.mainPart.willRestoreState) {
|
|
143
|
+
const state = this.loadState();
|
|
144
|
+
if (state) {
|
|
145
|
+
await this.restoreState(state);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const mostRecentActivePart = firstOrDefault(this.mostRecentActiveParts);
|
|
149
|
+
mostRecentActivePart?.activeGroup.focus();
|
|
150
|
+
this._isReady = true;
|
|
151
|
+
this.whenReadyPromise.complete();
|
|
152
|
+
await Promise.allSettled(( this.parts.map(part => part.whenRestored)));
|
|
153
|
+
this.whenRestoredPromise.complete();
|
|
154
|
+
}
|
|
155
|
+
loadState() {
|
|
156
|
+
return this.workspaceMemento[EditorParts_1.EDITOR_PARTS_UI_STATE_STORAGE_KEY];
|
|
157
|
+
}
|
|
158
|
+
saveState() {
|
|
159
|
+
const state = this.createState();
|
|
160
|
+
if (state.auxiliary.length === 0) {
|
|
161
|
+
delete this.workspaceMemento[EditorParts_1.EDITOR_PARTS_UI_STATE_STORAGE_KEY];
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.workspaceMemento[EditorParts_1.EDITOR_PARTS_UI_STATE_STORAGE_KEY] = state;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
createState() {
|
|
168
|
+
return {
|
|
169
|
+
auxiliary: ( this.parts.filter(part => part !== this.mainPart).map(part => {
|
|
170
|
+
return {
|
|
171
|
+
state: part.createState(),
|
|
172
|
+
bounds: (() => {
|
|
173
|
+
const auxiliaryWindow = getWindow(part.getContainer());
|
|
174
|
+
if (auxiliaryWindow) {
|
|
175
|
+
return {
|
|
176
|
+
x: auxiliaryWindow.screenX,
|
|
177
|
+
y: auxiliaryWindow.screenY,
|
|
178
|
+
width: auxiliaryWindow.outerWidth,
|
|
179
|
+
height: auxiliaryWindow.outerHeight
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return undefined;
|
|
183
|
+
})(),
|
|
184
|
+
zoomLevel: (() => {
|
|
185
|
+
const auxiliaryWindow = getWindow(part.getContainer());
|
|
186
|
+
if (auxiliaryWindow) {
|
|
187
|
+
return getZoomLevel(auxiliaryWindow);
|
|
188
|
+
}
|
|
189
|
+
return undefined;
|
|
190
|
+
})()
|
|
191
|
+
};
|
|
192
|
+
})),
|
|
193
|
+
mru: ( this.mostRecentActiveParts.map(part => this.parts.indexOf(part)))
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
async restoreState(state) {
|
|
197
|
+
if (state.auxiliary.length) {
|
|
198
|
+
const auxiliaryEditorPartPromises = [];
|
|
199
|
+
for (const auxiliaryEditorPartState of state.auxiliary) {
|
|
200
|
+
auxiliaryEditorPartPromises.push(this.createAuxiliaryEditorPart({
|
|
201
|
+
bounds: auxiliaryEditorPartState.bounds,
|
|
202
|
+
state: auxiliaryEditorPartState.state,
|
|
203
|
+
zoomLevel: auxiliaryEditorPartState.zoomLevel
|
|
204
|
+
}));
|
|
205
|
+
}
|
|
206
|
+
await Promise.allSettled(auxiliaryEditorPartPromises);
|
|
207
|
+
if (state.mru.length === this.parts.length) {
|
|
208
|
+
this.mostRecentActiveParts = ( state.mru.map(index => this.parts[index]));
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
this.mostRecentActiveParts = [...this.parts];
|
|
212
|
+
}
|
|
213
|
+
await Promise.allSettled(( this.parts.map(part => part.whenReady)));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
get hasRestorableState() {
|
|
217
|
+
return ( this.parts.some(part => part.hasRestorableState));
|
|
218
|
+
}
|
|
219
|
+
onDidChangeMementoState(e) {
|
|
220
|
+
if (e.external && e.scope === 1 ) {
|
|
221
|
+
this.reloadMemento(e.scope);
|
|
222
|
+
const state = this.loadState();
|
|
223
|
+
if (state) {
|
|
224
|
+
this.applyState(state);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
async applyState(state) {
|
|
229
|
+
for (const part of this.parts) {
|
|
230
|
+
if (part === this.mainPart) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
for (const group of part.getGroups(1 )) {
|
|
234
|
+
const closed = await group.closeAllEditors();
|
|
235
|
+
if (!closed) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
part.close();
|
|
240
|
+
}
|
|
241
|
+
await this.restoreState(state);
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
120
244
|
get activeGroup() {
|
|
121
245
|
return this.activePart.activeGroup;
|
|
122
246
|
}
|
|
@@ -258,8 +382,10 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
258
382
|
get partOptions() { return this.mainPart.partOptions; }
|
|
259
383
|
get onDidChangeEditorPartOptions() { return this.mainPart.onDidChangeEditorPartOptions; }
|
|
260
384
|
};
|
|
261
|
-
EditorParts = ( __decorate([
|
|
262
|
-
( __param(0, IInstantiationService))
|
|
385
|
+
EditorParts = EditorParts_1 = ( __decorate([
|
|
386
|
+
( __param(0, IInstantiationService)),
|
|
387
|
+
( __param(1, IStorageService)),
|
|
388
|
+
( __param(2, IThemeService))
|
|
263
389
|
], EditorParts));
|
|
264
390
|
|
|
265
391
|
export { EditorParts };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import n from '../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
2
|
|
|
3
|
-
var css = ".monaco-workbench .pane-composite-part>.title.has-composite-bar>.title-actions .monaco-action-bar .actions-container{justify-content:flex-end}.monaco-workbench .pane-composite-part>.title.has-composite-bar>.global-actions .monaco-action-bar .action-item,.monaco-workbench .pane-composite-part>.title.has-composite-bar>.title-actions .monaco-action-bar .action-item{
|
|
3
|
+
var css = ".monaco-workbench .pane-composite-part>.title.has-composite-bar>.title-actions .monaco-action-bar .actions-container{justify-content:flex-end}.monaco-workbench .pane-composite-part>.title.has-composite-bar>.global-actions .monaco-action-bar .action-item,.monaco-workbench .pane-composite-part>.title.has-composite-bar>.title-actions .monaco-action-bar .action-item{padding-right:4px}.monaco-workbench .pane-composite-part>.title.has-composite-bar>.title-actions .monaco-action-bar .action-item .action-label{outline-offset:-2px}.monaco-workbench .pane-composite-part>.title.has-composite-bar>.title-label{display:none}.monaco-workbench .pane-composite-part>.title>.composite-bar-container{display:flex}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-label.codicon-more{align-items:center;color:inherit!important;display:flex;justify-content:center;margin-left:0;margin-right:0}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar{height:35px;line-height:27px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item{display:flex;font-size:11px;padding:2px 10px;text-transform:uppercase}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.icon{height:24px;padding:0 5px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar .monaco-action-bar .action-label.codicon{font-size:18px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.icon .action-label:not(.codicon){height:16px;width:16px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:after,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:before{background-color:var(--insert-border-color);content:\"\";display:none;height:24px;opacity:0;position:absolute;transition-delay:.1s;transition-duration:0ms;transition-property:opacity;width:2px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container.dragged-over>.composite-bar>.monaco-action-bar .action-item:after,.monaco-workbench .pane-composite-part>.title>.composite-bar-container.dragged-over>.composite-bar>.monaco-action-bar .action-item:before{display:block}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:before{left:1px;margin-left:-2px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:after{margin-right:-2px;right:1px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:first-of-type:before{left:2px;margin-left:-2px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:last-of-type:after{margin-right:-2px;right:2px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.left:after,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.left:before,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.right:after,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.right:before{transition-delay:0s}.monaco-workbench .pane-composite-part>.title>.composite-bar-container.dragged-over-head>.composite-bar>.monaco-action-bar .action-item:first-of-type:before,.monaco-workbench .pane-composite-part>.title>.composite-bar-container.dragged-over-tail>.composite-bar>.monaco-action-bar .action-item:last-of-type:after,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.left:before,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.right+.action-item:before,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:last-of-type.right:after{opacity:1}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item .action-label{border-radius:0;margin-right:0;padding:2px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.icon .action-label.codicon,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:not(.icon) .action-label{background:none!important}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.checked .action-label{margin-right:0}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .badge{align-items:center;display:flex;margin-left:8px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.icon .badge{margin-left:0}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .badge .badge-content{border-radius:11px;box-sizing:border-box;display:inline-block;font-size:11px;font-weight:400;height:18px;line-height:11px;min-width:18px;padding:3px 5px;position:relative;text-align:center}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.icon .badge.compact{bottom:0;height:100%;left:0;margin:auto;overflow:hidden;position:absolute;top:0;width:100%;z-index:2}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.icon .badge.compact .badge-content{border-radius:16px;font-size:9px;font-weight:600;height:13px;line-height:13px;min-width:13px;padding:0 2px;position:absolute;right:0;text-align:center;top:11px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.icon .badge.compact.progress-badge .badge-content:before{left:1px;mask-size:11px;-webkit-mask-size:11px;top:3px}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item .active-item-indicator{bottom:0;height:100%;left:10px;overflow:hidden;pointer-events:none;position:absolute;top:-4px;width:calc(100% - 20px);z-index:1}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.icon .active-item-indicator{left:2px;top:1px;width:calc(100% - 4px)}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.checked .active-item-indicator:before,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:focus .active-item-indicator:before{border-top-style:solid;border-top-width:1px;bottom:0;content:\"\";height:0;position:absolute;width:100%;z-index:1}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.clicked:not(.checked):focus .active-item-indicator:before{border-top-color:transparent!important}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:focus .active-item-indicator:before{border-top-color:var(--vscode-focusBorder)!important}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.checked .action-label,.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:hover .action-label{outline:var(--vscode-contrastActiveBorder,unset) solid 1px!important}.monaco-workbench .pane-composite-part>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:not(.checked):hover .action-label{outline:var(--vscode-contrastActiveBorder,unset) dashed 1px!important}.monaco-workbench .pane-composite-part .empty-pane-message-area{display:none;height:100%;width:100%}.monaco-workbench .pane-composite-part .empty-pane-message-area.visible{align-content:center;align-items:center;display:flex;justify-content:center}.monaco-workbench .pane-composite-part .empty-pane-message-area .empty-pane-message{margin:12px;text-align:center}";
|
|
4
4
|
n(css,{});
|
|
5
5
|
|
|
6
6
|
export { css, css as default };
|
|
@@ -367,7 +367,7 @@ let PaneCompositeBar = class PaneCompositeBar extends Disposable {
|
|
|
367
367
|
name: cachedViewContainer.name,
|
|
368
368
|
order: cachedViewContainer.order,
|
|
369
369
|
pinned: cachedViewContainer.pinned,
|
|
370
|
-
visible: cachedViewContainer.visible,
|
|
370
|
+
visible: cachedViewContainer.visible && !!this.getViewContainer(cachedViewContainer.id),
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
373
|
for (const viewContainer of this.getViewContainers()) {
|
|
@@ -308,7 +308,7 @@ let AbstractPaneCompositePart = class AbstractPaneCompositePart extends Composit
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
layoutEmptyMessage() {
|
|
311
|
-
this.emptyPaneMessageElement?.classList.toggle('visible',
|
|
311
|
+
this.emptyPaneMessageElement?.classList.toggle('visible', !this.getActiveComposite());
|
|
312
312
|
}
|
|
313
313
|
updateGlobalToolbarActions() {
|
|
314
314
|
const primaryActions = this.globalActions.getPrimaryActions();
|
|
@@ -320,7 +320,7 @@ let AbstractPaneCompositePart = class AbstractPaneCompositePart extends Composit
|
|
|
320
320
|
if (!activePane || !this.toolBar) {
|
|
321
321
|
return 0;
|
|
322
322
|
}
|
|
323
|
-
return this.toolBar.getItemsWidth() + (this.globalToolBar?.getItemsWidth() ?? 0);
|
|
323
|
+
return this.toolBar.getItemsWidth() + 5 + (this.globalToolBar?.getItemsWidth() ?? 0);
|
|
324
324
|
}
|
|
325
325
|
onTitleAreaContextMenu(event) {
|
|
326
326
|
if (this.shouldShowCompositeBar() && this.paneCompositeBar.value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
2
|
|
|
3
|
-
var css = ".monaco-workbench.nosidebar>.part.sidebar{display:none!important;visibility:hidden!important}.monaco-workbench .part.sidebar .title-actions .actions-container{justify-content:flex-end}.monaco-workbench .part.sidebar .title-actions .action-item{margin-right:4px}.monaco-workbench .part.sidebar>.title>.title-label h2{text-transform:uppercase}.monaco-workbench .viewlet .collapsible.header .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-workbench .viewlet .collapsible.header .actions{width:0}.monaco-workbench .viewlet .collapsible.header.focused .actions,.monaco-workbench .viewlet .split-view-view:hover>.header .actions{flex:1;width:auto}.monaco-workbench .viewlet .collapsible.header .actions .action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;height:22px;margin-right:0;width:28px}.monaco-workbench .viewlet .collapsible.header .actions .action-label .label,.monaco-workbench .viewlet .collapsible.header.collapsed .actions{display:none}.monaco-workbench .viewlet .collapsible.header .action-label{background-repeat:no-repeat;height:16px;margin-right:.2em;width:16px}.monaco-workbench .sidebar.pane-composite-part>.title>.composite-bar-container{flex:1}.monaco-workbench .sidebar.part.pane-composite-part>.composite.title.has-composite-bar>.title-actions{flex:inherit}.monaco-workbench .sidebar.pane-composite-part>.title.has-composite-bar>.title-actions .monaco-action-bar .action-item{max-width:150px}";
|
|
3
|
+
var css = ".monaco-workbench.nosidebar>.part.sidebar{display:none!important;visibility:hidden!important}.monaco-workbench .part.sidebar .title-actions .actions-container{justify-content:flex-end}.monaco-workbench .part.sidebar .title-actions .action-item{margin-right:4px}.monaco-workbench .part.sidebar>.title>.title-label h2{text-transform:uppercase}.monaco-workbench .viewlet .collapsible.header .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-workbench .viewlet .collapsible.header .actions{width:0}.monaco-workbench .viewlet .collapsible.header.focused .actions,.monaco-workbench .viewlet .split-view-view:hover>.header .actions{flex:1;width:auto}.monaco-workbench .viewlet .collapsible.header .actions .action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;height:22px;margin-right:0;width:28px}.monaco-workbench .viewlet .collapsible.header .actions .action-label .label,.monaco-workbench .viewlet .collapsible.header.collapsed .actions{display:none}.monaco-workbench .viewlet .collapsible.header .action-label{background-repeat:no-repeat;height:16px;margin-right:.2em;width:16px}.monaco-workbench .part.sidebar>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.checked.clicked:focus .active-item-indicator:before,.monaco-workbench .part.sidebar>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item.checked:not(:focus) .active-item-indicator:before{border-top-color:var(--vscode-activityBarTop-activeBorder)!important}.monaco-workbench .part.sidebar>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:focus .action-label,.monaco-workbench .part.sidebar>.title>.composite-bar-container>.composite-bar>.monaco-action-bar .action-item:hover .action-label{color:var(--vscode-activityBarTop-foreground)!important}.monaco-workbench .sidebar.pane-composite-part>.title>.composite-bar-container{flex:1}.monaco-workbench .sidebar.part.pane-composite-part>.composite.title.has-composite-bar>.title-actions{flex:inherit}.monaco-workbench .sidebar.pane-composite-part>.title.has-composite-bar>.title-actions .monaco-action-bar .action-item{max-width:150px}";
|
|
4
4
|
n(css,{});
|
|
5
5
|
|
|
6
6
|
export { css, css as default };
|
|
@@ -15,8 +15,6 @@ import { AbstractPaneCompositePart } from '../paneCompositePart.js';
|
|
|
15
15
|
import { ActivityBarCompositeBar } from '../activitybar/activitybarPart.js';
|
|
16
16
|
import { IPaneCompositeBarOptions } from '../paneCompositeBar.js';
|
|
17
17
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
18
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
19
|
-
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
20
18
|
|
|
21
19
|
declare class SidebarPart extends AbstractPaneCompositePart {
|
|
22
20
|
private readonly configurationService;
|
|
@@ -28,7 +26,7 @@ declare class SidebarPart extends AbstractPaneCompositePart {
|
|
|
28
26
|
readonly priority: LayoutPriority;
|
|
29
27
|
get preferredWidth(): number | undefined;
|
|
30
28
|
private readonly acitivityBarPart;
|
|
31
|
-
constructor(notificationService: INotificationService, storageService: IStorageService, contextMenuService: IContextMenuService, layoutService: IWorkbenchLayoutService, keybindingService: IKeybindingService, instantiationService: IInstantiationService, themeService: IThemeService, viewDescriptorService: IViewDescriptorService, contextKeyService: IContextKeyService, extensionService: IExtensionService, configurationService: IConfigurationService,
|
|
29
|
+
constructor(notificationService: INotificationService, storageService: IStorageService, contextMenuService: IContextMenuService, layoutService: IWorkbenchLayoutService, keybindingService: IKeybindingService, instantiationService: IInstantiationService, themeService: IThemeService, viewDescriptorService: IViewDescriptorService, contextKeyService: IContextKeyService, extensionService: IExtensionService, configurationService: IConfigurationService, menuService: IMenuService);
|
|
32
30
|
private onDidChangeActivityBarLocation;
|
|
33
31
|
updateStyles(): void;
|
|
34
32
|
layout(width: number, height: number, top: number, left: number): void;
|
|
@@ -8,7 +8,7 @@ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/
|
|
|
8
8
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
9
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
10
10
|
import { contrastBorder } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
11
|
-
import { SIDE_BAR_BORDER, SIDE_BAR_TITLE_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND, SIDE_BAR_DRAG_AND_DROP_BACKGROUND,
|
|
11
|
+
import { SIDE_BAR_BORDER, SIDE_BAR_TITLE_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND, SIDE_BAR_DRAG_AND_DROP_BACKGROUND, ACTIVITY_BAR_TOP_ACTIVE_BORDER, ACTIVITY_BAR_TOP_FOREGROUND, ACTIVITY_BAR_TOP_INACTIVE_FOREGROUND, ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_TOP_DRAG_AND_DROP_BORDER } from 'vscode/vscode/vs/workbench/common/theme';
|
|
12
12
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
13
13
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
14
14
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
@@ -18,12 +18,9 @@ import { AbstractPaneCompositePart } from '../paneCompositePart.js';
|
|
|
18
18
|
import { ActivitybarPart, ActivityBarCompositeBar } from '../activitybar/activitybarPart.js';
|
|
19
19
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
20
20
|
import { registerAction2, Action2, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
21
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
22
|
-
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
23
21
|
import { Separator } from 'vscode/vscode/vs/base/common/actions';
|
|
24
22
|
import { ToggleActivityBarVisibilityActionId } from 'vscode/vscode/vs/workbench/browser/actions/layoutActions';
|
|
25
23
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
26
|
-
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
27
24
|
|
|
28
25
|
var SidebarPart_1;
|
|
29
26
|
let SidebarPart = class SidebarPart extends AbstractPaneCompositePart {
|
|
@@ -40,7 +37,7 @@ let SidebarPart = class SidebarPart extends AbstractPaneCompositePart {
|
|
|
40
37
|
}
|
|
41
38
|
return Math.max(width, 300);
|
|
42
39
|
}
|
|
43
|
-
constructor(notificationService, storageService, contextMenuService, layoutService, keybindingService, instantiationService, themeService, viewDescriptorService, contextKeyService, extensionService, configurationService,
|
|
40
|
+
constructor(notificationService, storageService, contextMenuService, layoutService, keybindingService, instantiationService, themeService, viewDescriptorService, contextKeyService, extensionService, configurationService, menuService) {
|
|
44
41
|
super("workbench.parts.sidebar" , { hasTitle: true, borderWidth: () => (this.getColor(SIDE_BAR_BORDER) || this.getColor(contrastBorder)) ? 1 : 0 }, SidebarPart_1.activeViewletSettingsKey, ActiveViewletContext.bindTo(contextKeyService), SidebarFocusContext.bindTo(contextKeyService), 'sideBar', 'viewlet', SIDE_BAR_TITLE_FOREGROUND, notificationService, storageService, contextMenuService, layoutService, keybindingService, instantiationService, themeService, viewDescriptorService, contextKeyService, extensionService, menuService);
|
|
45
42
|
this.configurationService = configurationService;
|
|
46
43
|
this.minimumWidth = 170;
|
|
@@ -56,9 +53,6 @@ let SidebarPart = class SidebarPart extends AbstractPaneCompositePart {
|
|
|
56
53
|
}
|
|
57
54
|
}));
|
|
58
55
|
this.registerActions();
|
|
59
|
-
lifecycleService.when(4 ).then(() => {
|
|
60
|
-
telemetryService.publicLog2('activityBar:location', { location: configurationService.getValue("workbench.activityBar.location" ) });
|
|
61
|
-
});
|
|
62
56
|
}
|
|
63
57
|
onDidChangeActivityBarLocation() {
|
|
64
58
|
this.updateTitleArea();
|
|
@@ -121,18 +115,18 @@ let SidebarPart = class SidebarPart extends AbstractPaneCompositePart {
|
|
|
121
115
|
colors: theme => ({
|
|
122
116
|
activeBackgroundColor: theme.getColor(SIDE_BAR_BACKGROUND),
|
|
123
117
|
inactiveBackgroundColor: theme.getColor(SIDE_BAR_BACKGROUND),
|
|
124
|
-
activeBorderBottomColor: theme.getColor(
|
|
125
|
-
activeForegroundColor: theme.getColor(
|
|
126
|
-
inactiveForegroundColor: theme.getColor(
|
|
118
|
+
activeBorderBottomColor: theme.getColor(ACTIVITY_BAR_TOP_ACTIVE_BORDER),
|
|
119
|
+
activeForegroundColor: theme.getColor(ACTIVITY_BAR_TOP_FOREGROUND),
|
|
120
|
+
inactiveForegroundColor: theme.getColor(ACTIVITY_BAR_TOP_INACTIVE_FOREGROUND),
|
|
127
121
|
badgeBackground: theme.getColor(ACTIVITY_BAR_BADGE_BACKGROUND),
|
|
128
122
|
badgeForeground: theme.getColor(ACTIVITY_BAR_BADGE_FOREGROUND),
|
|
129
|
-
dragAndDropBorder: theme.getColor(
|
|
123
|
+
dragAndDropBorder: theme.getColor(ACTIVITY_BAR_TOP_DRAG_AND_DROP_BORDER)
|
|
130
124
|
}),
|
|
131
125
|
compact: true
|
|
132
126
|
};
|
|
133
127
|
}
|
|
134
128
|
shouldShowCompositeBar() {
|
|
135
|
-
return this.
|
|
129
|
+
return this.configurationService.getValue("workbench.activityBar.location" ) === "top" ;
|
|
136
130
|
}
|
|
137
131
|
shouldShowActivityBar() {
|
|
138
132
|
if (this.shouldShowCompositeBar()) {
|
|
@@ -222,9 +216,7 @@ SidebarPart = SidebarPart_1 = ( __decorate([
|
|
|
222
216
|
( __param(8, IContextKeyService)),
|
|
223
217
|
( __param(9, IExtensionService)),
|
|
224
218
|
( __param(10, IConfigurationService)),
|
|
225
|
-
( __param(11,
|
|
226
|
-
( __param(12, ILifecycleService)),
|
|
227
|
-
( __param(13, IMenuService))
|
|
219
|
+
( __param(11, IMenuService))
|
|
228
220
|
], SidebarPart));
|
|
229
221
|
|
|
230
222
|
export { SidebarPart };
|