@codingame/monaco-vscode-workbench-service-override 37.6.0 → 37.6.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/index.js +2 -2
- package/package.json +10 -10
- package/session.js +2 -2
- package/vscode/src/vs/sessions/contrib/editor/browser/addTabActions.js +5 -3
- package/vscode/src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.js +3 -22
- package/vscode/src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.js +2 -2
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneExistingSessionStrategy.js +1 -1
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3Prompt.js +19 -19
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionTour.js +4 -4
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTour.js +6 -6
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTourShared.js +2 -2
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV2Tour.js +4 -4
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.js +24 -24
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostClaudePermissionModePicker.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostCodexApprovalsPicker.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.js +2 -2
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerDelegate.js +8 -8
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.js +32 -32
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentMergeActions.js +29 -29
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/exportDebugLogsAction.js +1 -1
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService.js +6 -6
- package/vscode/src/vs/sessions/contrib/search/browser/search.contribution.js +3 -3
- package/vscode/src/vs/sessions/contrib/search/browser/searchEditorEmptyState.contribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsIndicatorModel.js +4 -4
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsList.js +5 -5
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionDetailsAction.js +2 -2
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessions.contribution.js +8 -8
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsActions.js +58 -58
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.js +8 -8
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsWindowNotifier.js +5 -5
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationTemplates.js +10 -10
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.js +38 -38
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsView.js +118 -118
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.js +53 -53
- package/vscode/src/vs/sessions/contrib/terminal/browser/agentHostSessionTaskRunner.js +1 -1
- package/vscode/src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.js +2 -2
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsManagementService.js +2 -2
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsService.js +2 -2
- package/vscode/src/vs/workbench/browser/layout.d.ts +46 -70
- package/vscode/src/vs/workbench/browser/layout.js +243 -44
- package/vscode/src/vs/workbench/browser/workbench.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/workbench.js +3 -4
|
@@ -2,57 +2,57 @@
|
|
|
2
2
|
import { onDidChangeFullscreen, isFullscreen, isWCOEnabled } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/browser';
|
|
3
3
|
import { Dimension, getActiveDocument, getWindows, getClientArea, getWindow, createElement, addDisposableListener, EventType, isActiveDocument, getActiveElement, getActiveWindow, isAncestorUsingFlowTo, getFullscreenElement, size, computeScreenAwareSize, getWindowId } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
4
|
import { setContainerElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/domStylesheets';
|
|
5
|
-
import { alert } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
6
5
|
import { SerializableGrid, Sizing, Direction } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/grid/grid';
|
|
7
6
|
import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/window';
|
|
8
7
|
import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
9
8
|
import { DeferredPromise, Promises } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
10
9
|
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
11
|
-
import { toDisposable, DisposableStore, DisposableMap
|
|
12
|
-
import {
|
|
10
|
+
import { Disposable, toDisposable, DisposableStore, DisposableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
11
|
+
import { alert } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
13
12
|
import { isWindows, isLinux, isWeb, isIOS, isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
13
|
+
import { pathsToEditors, isResourceEditorInput, EditorInputCapabilities } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
14
|
+
import { SidebarPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/sidebar/sidebarPart';
|
|
15
|
+
import { PanelPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/panel/panelPart';
|
|
16
|
+
import { LayoutSettings, Parts, EditorActionsLocation, ActivityBarPosition, shouldShowCustomTitleBar, ModernUIDensity, Position, isHorizontal, ZenModeSettings, isMultiWindowPart, isFloatingTopEdgeExposed, positionToString, partOpensMaximizedFromString, PartOpensMaximizedOptions, positionFromString } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
17
|
+
import { WorkbenchState, isTemporaryWorkspace } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace';
|
|
18
|
+
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
19
|
+
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
20
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
18
21
|
import { isConfigured, isDefaultOverriden } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
19
22
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
20
|
-
import {
|
|
23
|
+
import { ChatAIDisabledSettingId } from '@codingame/monaco-vscode-api/vscode/vs/platform/chat/common/chatSettings';
|
|
24
|
+
import { ITitleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/title/browser/titleService.service';
|
|
25
|
+
import { StartupKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
26
|
+
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
27
|
+
import { MenuSettings, TitleBarSetting, DEFAULT_EMPTY_WINDOW_SIZE, DEFAULT_WORKSPACE_WINDOW_SIZE, CustomTitleBarVisibility, hasNativeTitlebar, getMenuBarVisibility, useWindowControlsOverlay, hasNativeMenu } from '@codingame/monaco-vscode-api/vscode/vs/platform/window/common/window';
|
|
28
|
+
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
29
|
+
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
30
|
+
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
31
|
+
import { GroupActivationReason, GroupsOrder, GroupOrientation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
32
|
+
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
33
|
+
import { Part } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/part';
|
|
34
|
+
import { IStatusbarService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
35
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
36
|
+
import { isCodeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
|
|
37
|
+
import { assertReturnsDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
21
38
|
import { NotificationsFilter } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification';
|
|
22
39
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
23
|
-
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
24
|
-
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
25
|
-
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
26
|
-
import { isHighContrast } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/theme';
|
|
27
40
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
28
|
-
import {
|
|
29
|
-
import { WorkbenchState } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace';
|
|
30
|
-
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
31
|
-
import { EditorInputCapabilities } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
32
|
-
import { DiffEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/diffEditorInput';
|
|
41
|
+
import { isHighContrast } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/theme';
|
|
33
42
|
import { WINDOW_ACTIVE_BORDER, WINDOW_INACTIVE_BORDER } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/theme';
|
|
43
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
34
44
|
import { ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
35
45
|
import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
|
|
46
|
+
import { DiffEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/diffEditorInput';
|
|
47
|
+
import { mark } from '@codingame/monaco-vscode-api/vscode/vs/base/common/performance';
|
|
48
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
49
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
36
50
|
import { IAuxiliaryWindowService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.service';
|
|
51
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
37
52
|
import { IBannerService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/banner/browser/bannerService.service';
|
|
38
|
-
import { GroupActivationReason, GroupOrientation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
39
|
-
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
40
|
-
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
41
|
-
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
42
53
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
43
|
-
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
44
|
-
import { LayoutSettings, Parts, EditorActionsLocation, ActivityBarPosition, shouldShowCustomTitleBar, ModernUIDensity, Position, isHorizontal, ZenModeSettings, isMultiWindowPart, isFloatingTopEdgeExposed, positionToString, partOpensMaximizedFromString, PartOpensMaximizedOptions, positionFromString } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
45
|
-
import { StartupKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
46
|
-
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
47
54
|
import { IPaneCompositePartService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
|
|
48
|
-
import { IStatusbarService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
49
|
-
import { ITitleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/title/browser/titleService.service';
|
|
50
|
-
import { AbstractLayout, WorkbenchLayoutSettings } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/abstractlayout';
|
|
51
|
-
export { AbstractLayout, WorkbenchLayoutSettings } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/abstractlayout';
|
|
52
|
-
import { Part } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/part';
|
|
53
55
|
import { AuxiliaryBarPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart';
|
|
54
|
-
import { PanelPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/panel/panelPart';
|
|
55
|
-
import { SidebarPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/sidebar/sidebarPart';
|
|
56
56
|
import { Orientation } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/sash/sash';
|
|
57
57
|
import '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/grid/gridview';
|
|
58
58
|
|
|
@@ -92,7 +92,7 @@ const TITLE_BAR_SETTINGS = [
|
|
|
92
92
|
];
|
|
93
93
|
const DEFAULT_EMPTY_WINDOW_DIMENSIONS = ( new Dimension(DEFAULT_EMPTY_WINDOW_SIZE.width, DEFAULT_EMPTY_WINDOW_SIZE.height));
|
|
94
94
|
const DEFAULT_WORKSPACE_WINDOW_DIMENSIONS = ( new Dimension(DEFAULT_WORKSPACE_WINDOW_SIZE.width, DEFAULT_WORKSPACE_WINDOW_SIZE.height));
|
|
95
|
-
class Layout extends
|
|
95
|
+
class Layout extends Disposable {
|
|
96
96
|
get activeContainer() {
|
|
97
97
|
return this.getContainerFromDocument(getActiveDocument());
|
|
98
98
|
}
|
|
@@ -156,8 +156,9 @@ class Layout extends AbstractLayout {
|
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
constructor(parent, layoutOptions) {
|
|
159
|
-
super(
|
|
159
|
+
super();
|
|
160
160
|
this.parent = parent;
|
|
161
|
+
this.layoutOptions = layoutOptions;
|
|
161
162
|
this._onDidChangeZenMode = this._register(( new Emitter()));
|
|
162
163
|
this.onDidChangeZenMode = this._onDidChangeZenMode.event;
|
|
163
164
|
this._onDidChangeMainEditorCenteredLayout = this._register(( new Emitter()));
|
|
@@ -189,6 +190,7 @@ class Layout extends AbstractLayout {
|
|
|
189
190
|
this.parts = ( new Map());
|
|
190
191
|
this.initialized = false;
|
|
191
192
|
this.disposed = false;
|
|
193
|
+
this._openedDefaultEditors = false;
|
|
192
194
|
this.whenReadyPromise = ( new DeferredPromise());
|
|
193
195
|
this.whenReady = this.whenReadyPromise.p;
|
|
194
196
|
this.whenRestoredPromise = ( new DeferredPromise());
|
|
@@ -218,7 +220,7 @@ class Layout extends AbstractLayout {
|
|
|
218
220
|
this.statusBarService = accessor.get(IStatusbarService);
|
|
219
221
|
accessor.get(IBannerService);
|
|
220
222
|
this.registerLayoutListeners();
|
|
221
|
-
this.initLayoutState(accessor);
|
|
223
|
+
this.initLayoutState(accessor.get(ILifecycleService), accessor.get(IFileService));
|
|
222
224
|
}
|
|
223
225
|
registerLayoutListeners() {
|
|
224
226
|
const showEditorIfHidden = explicitUserAction => {
|
|
@@ -508,7 +510,7 @@ class Layout extends AbstractLayout {
|
|
|
508
510
|
this.layout();
|
|
509
511
|
}
|
|
510
512
|
}
|
|
511
|
-
initLayoutState(
|
|
513
|
+
initLayoutState(lifecycleService, fileService) {
|
|
512
514
|
this._mainContainerDimension = getClientArea(
|
|
513
515
|
this.parent,
|
|
514
516
|
this.contextService.getWorkbenchState() === WorkbenchState.EMPTY ? DEFAULT_EMPTY_WINDOW_DIMENSIONS : DEFAULT_WORKSPACE_WINDOW_DIMENSIONS
|
|
@@ -536,6 +538,23 @@ class Layout extends AbstractLayout {
|
|
|
536
538
|
}
|
|
537
539
|
this.doUpdateLayoutConfiguration();
|
|
538
540
|
}));
|
|
541
|
+
const initialEditorsState = this.getInitialEditorsState();
|
|
542
|
+
if (initialEditorsState) {
|
|
543
|
+
this.logService.trace("Initial editor state", initialEditorsState);
|
|
544
|
+
}
|
|
545
|
+
const initialLayoutState = {
|
|
546
|
+
layout: {
|
|
547
|
+
editors: initialEditorsState?.layout
|
|
548
|
+
},
|
|
549
|
+
editor: {
|
|
550
|
+
restoreEditors: this.shouldRestoreEditors(this.contextService, initialEditorsState),
|
|
551
|
+
editorsToOpen: this.resolveEditorsToOpen(fileService, initialEditorsState)
|
|
552
|
+
},
|
|
553
|
+
views: {
|
|
554
|
+
defaults: this.getDefaultLayoutViews(this.environmentService, this.storageService),
|
|
555
|
+
containerToRestore: {}
|
|
556
|
+
}
|
|
557
|
+
};
|
|
539
558
|
const layoutRuntimeState = {
|
|
540
559
|
activeContainerId: this.getActiveContainerId(),
|
|
541
560
|
mainWindowFullscreen: isFullscreen(mainWindow),
|
|
@@ -550,7 +569,7 @@ class Layout extends AbstractLayout {
|
|
|
550
569
|
}
|
|
551
570
|
};
|
|
552
571
|
this.state = {
|
|
553
|
-
initialization:
|
|
572
|
+
initialization: initialLayoutState,
|
|
554
573
|
runtime: layoutRuntimeState
|
|
555
574
|
};
|
|
556
575
|
if (this.isVisible(Parts.SIDEBAR_PART)) {
|
|
@@ -559,7 +578,7 @@ class Layout extends AbstractLayout {
|
|
|
559
578
|
StorageScope.WORKSPACE,
|
|
560
579
|
this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id
|
|
561
580
|
);
|
|
562
|
-
if (!this.environmentService.isBuilt ||
|
|
581
|
+
if (!this.environmentService.isBuilt || lifecycleService.startupKind === StartupKind.ReloadedWindow || this.environmentService.isExtensionDevelopment && !this.environmentService.extensionTestsLocationURI)
|
|
563
582
|
; else if (viewContainerToRestore !== this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id && viewContainerToRestore !== this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.AuxiliaryBar)?.id) {
|
|
564
583
|
viewContainerToRestore = this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id;
|
|
565
584
|
}
|
|
@@ -595,18 +614,187 @@ class Layout extends AbstractLayout {
|
|
|
595
614
|
}
|
|
596
615
|
this.updateWindowBorder(true);
|
|
597
616
|
}
|
|
617
|
+
getDefaultLayoutViews(environmentService, storageService) {
|
|
618
|
+
const defaultLayout = environmentService.options?.defaultLayout;
|
|
619
|
+
if (!defaultLayout) {
|
|
620
|
+
return undefined;
|
|
621
|
+
}
|
|
622
|
+
if (!defaultLayout.force && !storageService.isNew(StorageScope.WORKSPACE)) {
|
|
623
|
+
return undefined;
|
|
624
|
+
}
|
|
625
|
+
const {
|
|
626
|
+
views
|
|
627
|
+
} = defaultLayout;
|
|
628
|
+
if (views?.length) {
|
|
629
|
+
return views.map(view => view.id);
|
|
630
|
+
}
|
|
631
|
+
return undefined;
|
|
632
|
+
}
|
|
633
|
+
shouldRestoreEditors(contextService, initialEditorsState) {
|
|
634
|
+
if (isTemporaryWorkspace(contextService.getWorkspace())) {
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
637
|
+
if (this.configurationService.getValue(WorkbenchLayoutSettings.EDITOR_RESTORE_EDITORS) === false) {
|
|
638
|
+
return false;
|
|
639
|
+
}
|
|
640
|
+
const forceRestoreEditors = this.configurationService.getValue("window.restoreWindows") === "preserve";
|
|
641
|
+
return !!forceRestoreEditors || initialEditorsState === undefined;
|
|
642
|
+
}
|
|
598
643
|
willRestoreEditors() {
|
|
599
644
|
return this.state.initialization.editor.restoreEditors;
|
|
600
645
|
}
|
|
646
|
+
async resolveEditorsToOpen(fileService, initialEditorsState) {
|
|
647
|
+
if (initialEditorsState) {
|
|
648
|
+
const filesToMerge = coalesce(
|
|
649
|
+
await pathsToEditors(initialEditorsState.filesToMerge, fileService, this.logService)
|
|
650
|
+
);
|
|
651
|
+
if (filesToMerge.length === 4 && isResourceEditorInput(filesToMerge[0]) && isResourceEditorInput(filesToMerge[1]) && isResourceEditorInput(filesToMerge[2]) && isResourceEditorInput(filesToMerge[3])) {
|
|
652
|
+
return [{
|
|
653
|
+
editor: {
|
|
654
|
+
input1: {
|
|
655
|
+
resource: filesToMerge[0].resource
|
|
656
|
+
},
|
|
657
|
+
input2: {
|
|
658
|
+
resource: filesToMerge[1].resource
|
|
659
|
+
},
|
|
660
|
+
base: {
|
|
661
|
+
resource: filesToMerge[2].resource
|
|
662
|
+
},
|
|
663
|
+
result: {
|
|
664
|
+
resource: filesToMerge[3].resource
|
|
665
|
+
},
|
|
666
|
+
options: {
|
|
667
|
+
pinned: true
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}];
|
|
671
|
+
}
|
|
672
|
+
const filesToDiff = coalesce(
|
|
673
|
+
await pathsToEditors(initialEditorsState.filesToDiff, fileService, this.logService)
|
|
674
|
+
);
|
|
675
|
+
if (filesToDiff.length === 2) {
|
|
676
|
+
return [{
|
|
677
|
+
editor: {
|
|
678
|
+
original: {
|
|
679
|
+
resource: filesToDiff[0].resource
|
|
680
|
+
},
|
|
681
|
+
modified: {
|
|
682
|
+
resource: filesToDiff[1].resource
|
|
683
|
+
},
|
|
684
|
+
options: {
|
|
685
|
+
pinned: true
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}];
|
|
689
|
+
}
|
|
690
|
+
const filesToOpenOrCreate = [];
|
|
691
|
+
const resolvedFilesToOpenOrCreate = await pathsToEditors(initialEditorsState.filesToOpenOrCreate, fileService, this.logService);
|
|
692
|
+
for (let i = 0; i < resolvedFilesToOpenOrCreate.length; i++) {
|
|
693
|
+
const resolvedFileToOpenOrCreate = resolvedFilesToOpenOrCreate[i];
|
|
694
|
+
if (resolvedFileToOpenOrCreate) {
|
|
695
|
+
filesToOpenOrCreate.push({
|
|
696
|
+
editor: resolvedFileToOpenOrCreate,
|
|
697
|
+
viewColumn: initialEditorsState.filesToOpenOrCreate?.[i].viewColumn
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
return filesToOpenOrCreate;
|
|
702
|
+
}
|
|
703
|
+
else if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY && this.configurationService.getValue("workbench.startupEditor") === "newUntitledFile") {
|
|
704
|
+
if (this.editorGroupService.hasRestorableState) {
|
|
705
|
+
return [];
|
|
706
|
+
}
|
|
707
|
+
return [{
|
|
708
|
+
editor: {
|
|
709
|
+
resource: undefined
|
|
710
|
+
}
|
|
711
|
+
}];
|
|
712
|
+
}
|
|
713
|
+
return [];
|
|
714
|
+
}
|
|
715
|
+
get openedDefaultEditors() {
|
|
716
|
+
return this._openedDefaultEditors;
|
|
717
|
+
}
|
|
718
|
+
getInitialEditorsState() {
|
|
719
|
+
const defaultLayout = this.environmentService.options?.defaultLayout;
|
|
720
|
+
if ((defaultLayout?.editors?.length || defaultLayout?.layout?.editors) && (defaultLayout.force || this.storageService.isNew(StorageScope.WORKSPACE))) {
|
|
721
|
+
this._openedDefaultEditors = true;
|
|
722
|
+
return {
|
|
723
|
+
layout: defaultLayout.layout?.editors,
|
|
724
|
+
filesToOpenOrCreate: defaultLayout?.editors?.map(editor => {
|
|
725
|
+
return {
|
|
726
|
+
viewColumn: editor.viewColumn,
|
|
727
|
+
fileUri: URI.revive(editor.uri),
|
|
728
|
+
openOnlyIfExists: editor.openOnlyIfExists,
|
|
729
|
+
options: editor.options
|
|
730
|
+
};
|
|
731
|
+
})
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
const {
|
|
735
|
+
filesToOpenOrCreate,
|
|
736
|
+
filesToDiff,
|
|
737
|
+
filesToMerge
|
|
738
|
+
} = this.environmentService;
|
|
739
|
+
if (filesToOpenOrCreate || filesToDiff || filesToMerge) {
|
|
740
|
+
return {
|
|
741
|
+
filesToOpenOrCreate,
|
|
742
|
+
filesToDiff,
|
|
743
|
+
filesToMerge
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
return undefined;
|
|
747
|
+
}
|
|
601
748
|
isRestored() {
|
|
602
749
|
return this.restored;
|
|
603
750
|
}
|
|
604
|
-
restoreParts(
|
|
751
|
+
restoreParts(instantiationService) {
|
|
605
752
|
const layoutReadyPromises = [];
|
|
606
753
|
const layoutRestoredPromises = [];
|
|
607
|
-
layoutReadyPromises.push(
|
|
608
|
-
|
|
609
|
-
|
|
754
|
+
layoutReadyPromises.push((async () => {
|
|
755
|
+
mark("code/willRestoreEditors");
|
|
756
|
+
await this.editorGroupService.whenReady;
|
|
757
|
+
mark("code/restoreEditors/editorGroupsReady");
|
|
758
|
+
if (this.state.initialization.layout?.editors) {
|
|
759
|
+
this.editorGroupService.mainPart.applyLayout(this.state.initialization.layout.editors);
|
|
760
|
+
}
|
|
761
|
+
const editors = await this.state.initialization.editor.editorsToOpen;
|
|
762
|
+
mark("code/restoreEditors/editorsToOpenResolved");
|
|
763
|
+
let openEditorsPromise = undefined;
|
|
764
|
+
if (editors.length) {
|
|
765
|
+
const editorGroupsInVisualOrder = this.editorGroupService.mainPart.getGroups(GroupsOrder.GRID_APPEARANCE);
|
|
766
|
+
const mapEditorsToGroup = ( new Map());
|
|
767
|
+
for (const editor of editors) {
|
|
768
|
+
const group = editorGroupsInVisualOrder[(editor.viewColumn ?? 1) - 1];
|
|
769
|
+
let editorsByGroup = mapEditorsToGroup.get(group.id);
|
|
770
|
+
if (!editorsByGroup) {
|
|
771
|
+
editorsByGroup = ( new Set());
|
|
772
|
+
mapEditorsToGroup.set(group.id, editorsByGroup);
|
|
773
|
+
}
|
|
774
|
+
editorsByGroup.add(editor.editor);
|
|
775
|
+
}
|
|
776
|
+
openEditorsPromise = Promise.all(Array.from(mapEditorsToGroup).map(async ([groupId, editors]) => {
|
|
777
|
+
try {
|
|
778
|
+
await this.editorService.openEditors(Array.from(editors), groupId, {
|
|
779
|
+
validateTrust: true
|
|
780
|
+
});
|
|
781
|
+
} catch (error) {
|
|
782
|
+
this.logService.error(error);
|
|
783
|
+
}
|
|
784
|
+
}));
|
|
785
|
+
}
|
|
786
|
+
const customEditorRestorePromise = instantiationService.invokeFunction(
|
|
787
|
+
this.layoutOptions?.customEditorRestore ?? (async () => {}),
|
|
788
|
+
!!this.state.initialization.layout?.editors
|
|
789
|
+
);
|
|
790
|
+
layoutRestoredPromises.push(Promise.all([
|
|
791
|
+
openEditorsPromise?.finally(() => mark("code/restoreEditors/editorsOpened")),
|
|
792
|
+
customEditorRestorePromise?.finally(() => mark("code/restoreEditors/customEditorsOpened")),
|
|
793
|
+
this.editorGroupService.whenRestored.finally(() => mark("code/restoreEditors/editorGroupsRestored"))
|
|
794
|
+
]).finally(() => {
|
|
795
|
+
mark("code/didRestoreEditors");
|
|
796
|
+
}));
|
|
797
|
+
})());
|
|
610
798
|
const restoreDefaultViewsPromise = (async () => {
|
|
611
799
|
if (this.state.initialization.views.defaults?.length) {
|
|
612
800
|
mark("code/willOpenDefaultViews");
|
|
@@ -1653,7 +1841,7 @@ class Layout extends AbstractLayout {
|
|
|
1653
1841
|
toggleSecondarySideBar() {
|
|
1654
1842
|
const visible = !this.isSecondarySideBarVisible();
|
|
1655
1843
|
this.setPartHidden(!visible, Parts.AUXILIARYBAR_PART);
|
|
1656
|
-
alert(visible ? ( localize(
|
|
1844
|
+
alert(visible ? ( localize(5595, "Secondary Side Bar shown")) : ( localize(5596, "Secondary Side Bar hidden")));
|
|
1657
1845
|
}
|
|
1658
1846
|
isSecondarySideBarVisible() {
|
|
1659
1847
|
return this.isVisible(Parts.AUXILIARYBAR_PART);
|
|
@@ -2169,6 +2357,17 @@ const LayoutStateKeys = {
|
|
|
2169
2357
|
true
|
|
2170
2358
|
))
|
|
2171
2359
|
};
|
|
2360
|
+
var WorkbenchLayoutSettings;
|
|
2361
|
+
(function(WorkbenchLayoutSettings) {
|
|
2362
|
+
WorkbenchLayoutSettings["AUXILIARYBAR_DEFAULT_VISIBILITY"] = "workbench.secondarySideBar.defaultVisibility";
|
|
2363
|
+
WorkbenchLayoutSettings["AUXILIARYBAR_FORCE_MAXIMIZED"] = "workbench.secondarySideBar.forceMaximized";
|
|
2364
|
+
WorkbenchLayoutSettings["ACTIVITY_BAR_VISIBLE"] = "workbench.activityBar.visible";
|
|
2365
|
+
WorkbenchLayoutSettings["PANEL_POSITION"] = "workbench.panel.defaultLocation";
|
|
2366
|
+
WorkbenchLayoutSettings["PANEL_OPENS_MAXIMIZED"] = "workbench.panel.opensMaximized";
|
|
2367
|
+
WorkbenchLayoutSettings["ZEN_MODE_CONFIG"] = "zenMode";
|
|
2368
|
+
WorkbenchLayoutSettings["EDITOR_CENTERED_LAYOUT_AUTO_RESIZE"] = "workbench.editor.centeredLayoutAutoResize";
|
|
2369
|
+
WorkbenchLayoutSettings["EDITOR_RESTORE_EDITORS"] = "workbench.editor.restoreEditors";
|
|
2370
|
+
})(WorkbenchLayoutSettings || (WorkbenchLayoutSettings = {}));
|
|
2172
2371
|
var LegacyWorkbenchLayoutSettings;
|
|
2173
2372
|
(function(LegacyWorkbenchLayoutSettings) {
|
|
2174
2373
|
LegacyWorkbenchLayoutSettings["STATUSBAR_VISIBLE"] = "workbench.statusBar.visible";
|
|
@@ -2445,4 +2644,4 @@ class LayoutStateModel extends Disposable {
|
|
|
2445
2644
|
}
|
|
2446
2645
|
}
|
|
2447
2646
|
|
|
2448
|
-
export { Layout,
|
|
2647
|
+
export { Layout, TITLE_BAR_SETTINGS };
|
|
@@ -42,5 +42,5 @@ export declare class Workbench extends Layout {
|
|
|
42
42
|
protected renderWorkbench(instantiationService: IInstantiationService, notificationService: NotificationService, storageService: IStorageService, configurationService: IConfigurationService): void;
|
|
43
43
|
private createPart;
|
|
44
44
|
protected createNotificationsHandlers(instantiationService: IInstantiationService, notificationService: NotificationService): void;
|
|
45
|
-
protected restore(
|
|
45
|
+
protected restore(instantiationService: IInstantiationService, lifecycleService: ILifecycleService): void;
|
|
46
46
|
}
|
|
@@ -111,7 +111,7 @@ class Workbench extends Layout {
|
|
|
111
111
|
);
|
|
112
112
|
this.createWorkbenchLayout();
|
|
113
113
|
this.layout();
|
|
114
|
-
this.restore(
|
|
114
|
+
this.restore(instantiationService, lifecycleService);
|
|
115
115
|
});
|
|
116
116
|
return instantiationService;
|
|
117
117
|
} catch (error) {
|
|
@@ -333,10 +333,9 @@ class Workbench extends Layout {
|
|
|
333
333
|
), () => notificationsToasts.isVisible || notificationsCenter.isVisible)
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
restore(
|
|
337
|
-
const lifecycleService = accessor.get(ILifecycleService);
|
|
336
|
+
restore(instantiationService, lifecycleService) {
|
|
338
337
|
try {
|
|
339
|
-
this.restoreParts(
|
|
338
|
+
this.restoreParts(instantiationService);
|
|
340
339
|
} catch (error) {
|
|
341
340
|
onUnexpectedError(error);
|
|
342
341
|
}
|