From f402cb3408fd7d8a5eaf7701f938595fb92f0df7 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 30 Nov 2017 10:29:26 +0100 Subject: [PATCH] have window id for renderer and exthost processes --- src/vs/workbench/api/node/extHost.protocol.ts | 1 + src/vs/workbench/electron-browser/main.ts | 3 ++- src/vs/workbench/node/extensionHostMain.ts | 3 ++- .../services/extensions/electron-browser/extensionHost.ts | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 358c436132d..134a7c47bcb 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -76,6 +76,7 @@ export interface IInitData { extensions: IExtensionDescription[]; configuration: IConfigurationInitData; telemetryInfo: ITelemetryInfo; + windowId: number; args: ParsedArgs; execPath: string; } diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index 61c5293e1fc..9e0d6cfe85c 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -73,12 +73,13 @@ function openWorkbench(configuration: IWindowConfiguration): TPromise { const mainServices = createMainProcessServices(mainProcessClient); const environmentService = new EnvironmentService(configuration, configuration.execPath); - const logService = new SpdLogService('renderer', environmentService); + const logService = new SpdLogService(`renderer${currentWindowId}`, environmentService); logService.info('openWorkbench', JSON.stringify(configuration)); // Since the configuration service is one of the core services that is used in so many places, we initialize it // right before startup of the workbench shell to have its data ready for consumers return createAndInitializeWorkspaceService(configuration, environmentService).then(workspaceService => { + const timerService = new TimerService((window).MonacoEnvironment.timers as IInitData, workspaceService.getWorkbenchState() === WorkbenchState.EMPTY); const storageService = createStorageService(workspaceService, environmentService); diff --git a/src/vs/workbench/node/extensionHostMain.ts b/src/vs/workbench/node/extensionHostMain.ts index 2b9d1d04059..710697d0286 100644 --- a/src/vs/workbench/node/extensionHostMain.ts +++ b/src/vs/workbench/node/extensionHostMain.ts @@ -86,7 +86,8 @@ export class ExtensionHostMain { const threadService = new ExtHostThreadService(rpcProtocol); const extHostWorkspace = new ExtHostWorkspace(threadService, initData.workspace); const environmentService = new EnvironmentService(initData.args, initData.execPath); - const logService = new SpdLogService('exthost', environmentService); + const logService = new SpdLogService(`exthost${initData.windowId}`, environmentService); + logService.info('main', JSON.stringify(initData)); this._extHostConfiguration = new ExtHostConfiguration(threadService.get(MainContext.MainThreadConfiguration), extHostWorkspace, initData.configuration); this._extensionService = new ExtHostExtensionService(initData, threadService, extHostWorkspace, this._extHostConfiguration, logService); diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts index 7c77059f29e..35a479d2796 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts @@ -365,7 +365,8 @@ export class ExtensionHostProcessWorker { configuration: !this._environmentService.isBuilt || this._environmentService.isExtensionDevelopment ? { ...configurationData, configurationScopes: getScopes(this._configurationService.keys().default) } : configurationData, telemetryInfo, args: this._environmentService.args, - execPath: this._environmentService.execPath + execPath: this._environmentService.execPath, + windowId: this._windowService.getCurrentWindowId() }; return r; });