From b208b7f3006541ba13f69e4e931cf83e72a4b5bb Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 11 Jul 2018 15:47:31 +0200 Subject: [PATCH] put context view inside workbench fixes #54030 --- src/vs/workbench/electron-browser/shell.ts | 7 ------- src/vs/workbench/electron-browser/workbench.ts | 8 +++++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index 049d3c1dba5..93100ec1d72 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -16,7 +16,6 @@ import { toErrorMessage } from 'vs/base/common/errorMessage'; import product from 'vs/platform/node/product'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import pkg from 'vs/platform/node/package'; -import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService'; import { Workbench, IWorkbenchStartedInfo } from 'vs/workbench/electron-browser/workbench'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService, configurationTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; @@ -46,7 +45,6 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { ILifecycleService, LifecyclePhase, ShutdownReason, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; import { IMarkerService } from 'vs/platform/markers/common/markers'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -120,7 +118,6 @@ export class WorkbenchShell extends Disposable { private storageService: IStorageService; private environmentService: IEnvironmentService; private logService: ILogService; - private contextViewService: ContextViewService; private configurationService: IConfigurationService; private contextService: IWorkspaceContextService; private telemetryService: ITelemetryService; @@ -409,9 +406,6 @@ export class WorkbenchShell extends Disposable { serviceCollection.set(ICommandService, new SyncDescriptor(CommandService)); - this.contextViewService = instantiationService.createInstance(ContextViewService, this.container); - serviceCollection.set(IContextViewService, this.contextViewService); - serviceCollection.set(IMarkerService, new SyncDescriptor(MarkerService)); serviceCollection.set(IModeService, new SyncDescriptor(WorkbenchModeServiceImpl)); @@ -507,7 +501,6 @@ export class WorkbenchShell extends Disposable { } private layout(): void { - this.contextViewService.layout(); this.workbench.layout(); } diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 0e156bcd17c..00aae6933f9 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -199,6 +199,7 @@ export class Workbench extends Disposable implements IPartService { private editorService: EditorService; private editorGroupService: IEditorGroupsService; private viewletService: IViewletService; + private contextViewService: ContextViewService; private contextKeyService: IContextKeyService; private keybindingService: IKeybindingService; private backupFileService: IBackupFileService; @@ -248,7 +249,6 @@ export class Workbench extends Disposable implements IPartService { @IEnvironmentService private environmentService: IEnvironmentService, @IWindowService private windowService: IWindowService, @INotificationService private notificationService: NotificationService, - @IContextViewService private contextViewService: ContextViewService, @ITelemetryService private telemetryService: TelemetryService ) { super(); @@ -352,6 +352,10 @@ export class Workbench extends Disposable implements IPartService { // List serviceCollection.set(IListService, this.instantiationService.createInstance(ListService)); + // Context view service + this.contextViewService = this.instantiationService.createInstance(ContextViewService, this.workbench.getHTMLElement()); + serviceCollection.set(IContextViewService, this.contextViewService); + // Use themable context menus when custom titlebar is enabled to match custom menubar if (!isMacintosh && this.getCustomTitleBarStyle() === 'custom') { serviceCollection.set(IContextMenuService, new SyncDescriptor(HTMLContextMenuService, null, this.telemetryService, this.notificationService, this.contextViewService)); @@ -1283,6 +1287,8 @@ export class Workbench extends Disposable implements IPartService { } layout(options?: ILayoutOptions): void { + this.contextViewService.layout(); + if (this.workbenchStarted && !this.workbenchShutdown) { this.workbenchLayout.layout(options); } -- GitLab