@codingame/monaco-vscode-workbench-service-override 37.3.11 → 37.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/index.js +2 -2
  2. package/package.json +10 -10
  3. package/session.d.ts +3 -0
  4. package/session.js +10 -3
  5. package/vscode/src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.js +22 -3
  6. package/vscode/src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.js +2 -2
  7. package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneExistingSessionStrategy.js +1 -1
  8. package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3Prompt.js +19 -19
  9. package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionTour.js +4 -4
  10. package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTour.js +6 -6
  11. package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTourShared.js +2 -2
  12. package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV2Tour.js +4 -4
  13. package/vscode/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.js +24 -24
  14. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostClaudePermissionModePicker.js +3 -3
  15. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostCodexApprovalsPicker.js +3 -3
  16. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.js +2 -2
  17. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerDelegate.js +8 -8
  18. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.js +3 -3
  19. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.js +32 -32
  20. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentMergeActions.js +29 -29
  21. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/exportDebugLogsAction.js +1 -1
  22. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.js +3 -3
  23. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService.js +6 -6
  24. package/vscode/src/vs/sessions/contrib/search/browser/search.contribution.js +3 -3
  25. package/vscode/src/vs/sessions/contrib/search/browser/searchEditorEmptyState.contribution.js +1 -1
  26. package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsIndicatorModel.js +4 -4
  27. package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsList.js +5 -5
  28. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionDetailsAction.js +2 -2
  29. package/vscode/src/vs/sessions/contrib/sessions/browser/sessions.contribution.js +8 -8
  30. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsActions.js +58 -58
  31. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.js +8 -8
  32. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsWindowNotifier.js +5 -5
  33. package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationTemplates.js +10 -10
  34. package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.js +38 -38
  35. package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsView.js +118 -118
  36. package/vscode/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.js +53 -53
  37. package/vscode/src/vs/sessions/contrib/terminal/browser/agentHostSessionTaskRunner.js +1 -1
  38. package/vscode/src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.js +2 -2
  39. package/vscode/src/vs/sessions/services/sessions/browser/sessionsManagementService.js +2 -2
  40. package/vscode/src/vs/sessions/services/sessions/browser/sessionsService.js +2 -2
  41. package/vscode/src/vs/workbench/browser/layout.d.ts +70 -46
  42. package/vscode/src/vs/workbench/browser/layout.js +44 -243
  43. package/vscode/src/vs/workbench/browser/workbench.d.ts +1 -1
  44. package/vscode/src/vs/workbench/browser/workbench.js +4 -3
@@ -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';
5
6
  import { SerializableGrid, Sizing, Direction } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/grid/grid';
6
7
  import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/window';
7
8
  import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
8
9
  import { DeferredPromise, Promises } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
9
10
  import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
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';
11
+ import { toDisposable, DisposableStore, DisposableMap, Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
12
+ import { mark } from '@codingame/monaco-vscode-api/vscode/vs/base/common/performance';
12
13
  import { isWindows, isLinux, isWeb, isIOS, isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
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';
14
+ import { assertReturnsDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
15
+ import { isCodeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
16
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
17
+ import { ChatAIDisabledSettingId } from '@codingame/monaco-vscode-api/vscode/vs/platform/chat/common/chatSettings';
21
18
  import { isConfigured, isDefaultOverriden } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
22
19
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
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';
20
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
38
21
  import { NotificationsFilter } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification';
39
22
  import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
40
- import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.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';
41
26
  import { isHighContrast } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/theme';
27
+ import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
28
+ 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';
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';
42
33
  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';
44
34
  import { ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
45
35
  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';
50
36
  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';
52
37
  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';
53
42
  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';
54
47
  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';
55
53
  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 Disposable {
95
+ class Layout extends AbstractLayout {
96
96
  get activeContainer() {
97
97
  return this.getContainerFromDocument(getActiveDocument());
98
98
  }
@@ -156,9 +156,8 @@ class Layout extends Disposable {
156
156
  };
157
157
  }
158
158
  constructor(parent, layoutOptions) {
159
- super();
159
+ super(layoutOptions);
160
160
  this.parent = parent;
161
- this.layoutOptions = layoutOptions;
162
161
  this._onDidChangeZenMode = this._register(( new Emitter()));
163
162
  this.onDidChangeZenMode = this._onDidChangeZenMode.event;
164
163
  this._onDidChangeMainEditorCenteredLayout = this._register(( new Emitter()));
@@ -190,7 +189,6 @@ class Layout extends Disposable {
190
189
  this.parts = ( new Map());
191
190
  this.initialized = false;
192
191
  this.disposed = false;
193
- this._openedDefaultEditors = false;
194
192
  this.whenReadyPromise = ( new DeferredPromise());
195
193
  this.whenReady = this.whenReadyPromise.p;
196
194
  this.whenRestoredPromise = ( new DeferredPromise());
@@ -220,7 +218,7 @@ class Layout extends Disposable {
220
218
  this.statusBarService = accessor.get(IStatusbarService);
221
219
  accessor.get(IBannerService);
222
220
  this.registerLayoutListeners();
223
- this.initLayoutState(accessor.get(ILifecycleService), accessor.get(IFileService));
221
+ this.initLayoutState(accessor);
224
222
  }
225
223
  registerLayoutListeners() {
226
224
  const showEditorIfHidden = explicitUserAction => {
@@ -510,7 +508,7 @@ class Layout extends Disposable {
510
508
  this.layout();
511
509
  }
512
510
  }
513
- initLayoutState(lifecycleService, fileService) {
511
+ initLayoutState(accessor) {
514
512
  this._mainContainerDimension = getClientArea(
515
513
  this.parent,
516
514
  this.contextService.getWorkbenchState() === WorkbenchState.EMPTY ? DEFAULT_EMPTY_WINDOW_DIMENSIONS : DEFAULT_WORKSPACE_WINDOW_DIMENSIONS
@@ -538,23 +536,6 @@ class Layout extends Disposable {
538
536
  }
539
537
  this.doUpdateLayoutConfiguration();
540
538
  }));
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
- };
558
539
  const layoutRuntimeState = {
559
540
  activeContainerId: this.getActiveContainerId(),
560
541
  mainWindowFullscreen: isFullscreen(mainWindow),
@@ -569,7 +550,7 @@ class Layout extends Disposable {
569
550
  }
570
551
  };
571
552
  this.state = {
572
- initialization: initialLayoutState,
553
+ initialization: this.getInitLayoutState(accessor),
573
554
  runtime: layoutRuntimeState
574
555
  };
575
556
  if (this.isVisible(Parts.SIDEBAR_PART)) {
@@ -578,7 +559,7 @@ class Layout extends Disposable {
578
559
  StorageScope.WORKSPACE,
579
560
  this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id
580
561
  );
581
- if (!this.environmentService.isBuilt || lifecycleService.startupKind === StartupKind.ReloadedWindow || this.environmentService.isExtensionDevelopment && !this.environmentService.extensionTestsLocationURI)
562
+ if (!this.environmentService.isBuilt || accessor.get(ILifecycleService).startupKind === StartupKind.ReloadedWindow || this.environmentService.isExtensionDevelopment && !this.environmentService.extensionTestsLocationURI)
582
563
  ; else if (viewContainerToRestore !== this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id && viewContainerToRestore !== this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.AuxiliaryBar)?.id) {
583
564
  viewContainerToRestore = this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id;
584
565
  }
@@ -614,187 +595,18 @@ class Layout extends Disposable {
614
595
  }
615
596
  this.updateWindowBorder(true);
616
597
  }
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
- }
643
598
  willRestoreEditors() {
644
599
  return this.state.initialization.editor.restoreEditors;
645
600
  }
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
- }
748
601
  isRestored() {
749
602
  return this.restored;
750
603
  }
751
- restoreParts(instantiationService) {
604
+ restoreParts(accessor) {
752
605
  const layoutReadyPromises = [];
753
606
  const layoutRestoredPromises = [];
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
- })());
607
+ layoutReadyPromises.push(
608
+ this.restoreLayout(accessor, this.state.initialization, layoutRestoredPromises)
609
+ );
798
610
  const restoreDefaultViewsPromise = (async () => {
799
611
  if (this.state.initialization.views.defaults?.length) {
800
612
  mark("code/willOpenDefaultViews");
@@ -1841,7 +1653,7 @@ class Layout extends Disposable {
1841
1653
  toggleSecondarySideBar() {
1842
1654
  const visible = !this.isSecondarySideBarVisible();
1843
1655
  this.setPartHidden(!visible, Parts.AUXILIARYBAR_PART);
1844
- alert(visible ? ( localize(5593, "Secondary Side Bar shown")) : ( localize(5594, "Secondary Side Bar hidden")));
1656
+ alert(visible ? ( localize(5594, "Secondary Side Bar shown")) : ( localize(5595, "Secondary Side Bar hidden")));
1845
1657
  }
1846
1658
  isSecondarySideBarVisible() {
1847
1659
  return this.isVisible(Parts.AUXILIARYBAR_PART);
@@ -2357,17 +2169,6 @@ const LayoutStateKeys = {
2357
2169
  true
2358
2170
  ))
2359
2171
  };
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 = {}));
2371
2172
  var LegacyWorkbenchLayoutSettings;
2372
2173
  (function(LegacyWorkbenchLayoutSettings) {
2373
2174
  LegacyWorkbenchLayoutSettings["STATUSBAR_VISIBLE"] = "workbench.statusBar.visible";
@@ -2644,4 +2445,4 @@ class LayoutStateModel extends Disposable {
2644
2445
  }
2645
2446
  }
2646
2447
 
2647
- export { Layout, TITLE_BAR_SETTINGS };
2448
+ export { Layout, LayoutStateModel, 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(instantiationService: IInstantiationService, lifecycleService: ILifecycleService): void;
45
+ protected restore(accessor: ServicesAccessor): void;
46
46
  }
@@ -111,7 +111,7 @@ class Workbench extends Layout {
111
111
  );
112
112
  this.createWorkbenchLayout();
113
113
  this.layout();
114
- this.restore(instantiationService, lifecycleService);
114
+ this.restore(accessor);
115
115
  });
116
116
  return instantiationService;
117
117
  } catch (error) {
@@ -333,9 +333,10 @@ class Workbench extends Layout {
333
333
  ), () => notificationsToasts.isVisible || notificationsCenter.isVisible)
334
334
  });
335
335
  }
336
- restore(instantiationService, lifecycleService) {
336
+ restore(accessor) {
337
+ const lifecycleService = accessor.get(ILifecycleService);
337
338
  try {
338
- this.restoreParts(instantiationService);
339
+ this.restoreParts(accessor);
339
340
  } catch (error) {
340
341
  onUnexpectedError(error);
341
342
  }