From 413a1db68bbcc68bded6d2512a6e48f5bb89264f Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 17 Aug 2016 12:45:54 +0200 Subject: [PATCH] remove more stuff from IWindowConfiguration --- src/vs/code/electron-main/window.ts | 26 -------------- src/vs/code/electron-main/windows.ts | 17 ---------- src/vs/platform/workspace/common/workspace.ts | 34 ------------------- src/vs/workbench/electron-browser/shell.ts | 10 +++--- 4 files changed, 5 insertions(+), 82 deletions(-) diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 9c3ff13c409..5c43957747d 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -89,22 +89,15 @@ export interface IPath { } export interface IWindowConfiguration extends ICommandLineArguments { - execPath: string; version: string; appName: string; applicationName: string; - darwinBundleIdentifier: string; appSettingsHome: string; appSettingsPath: string; appKeybindingsPath: string; userExtensionsHome: string; - mainIPCHandle: string; - sharedIPCHandle: string; appRoot: string; isBuilt: boolean; - commitHash: string; - updateFeedUrl: string; - updateChannel: string; recentFiles: string[]; recentFolders: string[]; workspacePath?: string; @@ -112,26 +105,7 @@ export interface IWindowConfiguration extends ICommandLineArguments { filesToCreate?: IPath[]; filesToDiff?: IPath[]; extensionsToInstall: string[]; - crashReporter: Electron.CrashReporterStartOptions; - extensionsGallery: { - serviceUrl: string; - itemUrl: string; - }; - extensionTips: { [id: string]: string; }; - welcomePage: string; - releaseNotesUrl: string; - licenseUrl: string; - productDownloadUrl: string; - enableTelemetry: boolean; userEnv: IProcessEnvironment; - aiConfig: { - key: string; - asimovKey: string; - }; - sendASmile: { - reportIssueUrl: string, - requestFeatureUrl: string - }; } export class VSCodeWindow { diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 336bc754302..f60bf6739f3 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -727,7 +727,6 @@ export class WindowsManager implements IWindowsService { private toConfiguration(userEnv: IProcessEnvironment, cli: ICommandLineArguments, workspacePath?: string, filesToOpen?: IPath[], filesToCreate?: IPath[], filesToDiff?: IPath[], extensionsToInstall?: string[]): IWindowConfiguration { let configuration: IWindowConfiguration = mixin({}, cli); // inherit all properties from CLI - configuration.execPath = process.execPath; configuration.workspacePath = workspacePath; configuration.filesToOpen = filesToOpen; configuration.filesToCreate = filesToCreate; @@ -735,29 +734,13 @@ export class WindowsManager implements IWindowsService { configuration.extensionsToInstall = extensionsToInstall; configuration.appName = this.envService.product.nameLong; configuration.applicationName = this.envService.product.applicationName; - configuration.darwinBundleIdentifier = this.envService.product.darwinBundleIdentifier; configuration.appRoot = this.envService.appRoot; configuration.version = pkg.version; - configuration.commitHash = this.envService.product.commit; configuration.appSettingsHome = this.envService.appSettingsHome; configuration.appSettingsPath = this.envService.appSettingsPath; configuration.appKeybindingsPath = this.envService.appKeybindingsPath; configuration.userExtensionsHome = this.envService.userExtensionsHome; - configuration.extensionTips = this.envService.product.extensionTips; - configuration.mainIPCHandle = this.envService.mainIPCHandle; - configuration.sharedIPCHandle = this.envService.sharedIPCHandle; configuration.isBuilt = this.envService.isBuilt; - configuration.crashReporter = this.envService.product.crashReporter; - configuration.extensionsGallery = this.envService.product.extensionsGallery; - configuration.welcomePage = this.envService.product.welcomePage; - configuration.productDownloadUrl = this.envService.product.downloadUrl; - configuration.releaseNotesUrl = this.envService.product.releaseNotesUrl; - configuration.licenseUrl = this.envService.product.licenseUrl; - configuration.updateFeedUrl = this.updateService.feedUrl; - configuration.updateChannel = this.updateService.channel; - configuration.aiConfig = this.envService.product.aiConfig; - configuration.sendASmile = this.envService.product.sendASmile; - configuration.enableTelemetry = this.envService.product.enableTelemetry; configuration.userEnv = userEnv; const recents = this.getRecentlyOpenedPaths(workspacePath, filesToOpen); diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index 44024e78e79..a4aa302cb68 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -88,31 +88,10 @@ export interface IEnvironment { appName: string; appRoot: string; isBuilt: boolean; - execPath: string; applicationName: string; - darwinBundleIdentifier: string; version: string; - commitHash: string; - - updateFeedUrl: string; - updateChannel: string; - - extensionsGallery: { - serviceUrl: string; - itemUrl: string; - }; - - extensionTips: { [id: string]: string; }; - - releaseNotesUrl: string; - licenseUrl: string; - productDownloadUrl: string; - - welcomePage: string; - - crashReporter: any; appSettingsHome: string; appSettingsPath: string; @@ -123,22 +102,9 @@ export interface IEnvironment { logExtensionHostCommunication: boolean; userExtensionsHome: string; - sharedIPCHandle: string; extensionDevelopmentPath: string; extensionTestsPath: string; recentFiles: string[]; recentFolders: string[]; - - enableTelemetry: boolean; - - aiConfig: { - key: string; - asimovKey: string; - }; - - sendASmile: { - reportIssueUrl: string, - requestFeatureUrl: string - }; } \ No newline at end of file diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index 0d35c74434f..2d5c07ee71a 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -152,9 +152,9 @@ export class WorkbenchShell { const [instantiationService, serviceCollection] = this.initServiceCollection(); //crash reporting - if (!!this.configuration.env.crashReporter) { - const crashReporter = instantiationService.createInstance(CrashReporter, this.configuration.env.version, this.configuration.env.commitHash); - crashReporter.start(this.configuration.env.crashReporter); + if (!!product.crashReporter) { + const crashReporter = instantiationService.createInstance(CrashReporter, pkg.version, product.commit); + crashReporter.start(product.crashReporter); } // Workbench @@ -244,7 +244,7 @@ export class WorkbenchShell { serviceCollection.set(IStorageService, this.storageService); // Telemetry - if (this.configuration.env.isBuilt && !this.environmentService.extensionDevelopmentPath && !!this.configuration.env.enableTelemetry) { + if (this.environmentService.isBuilt && !this.environmentService.extensionDevelopmentPath && !!product.enableTelemetry) { const channel = getDelayedChannel(sharedProcess.then(c => c.getChannel('telemetryAppender'))); const commit = product.commit; const version = pkg.version; @@ -252,7 +252,7 @@ export class WorkbenchShell { const config: ITelemetryServiceConfig = { appender: new TelemetryAppenderClient(channel), commonProperties: resolveWorkbenchCommonProperties(this.storageService, commit, version), - piiPaths: [this.configuration.env.appRoot, this.configuration.env.userExtensionsHome] + piiPaths: [this.environmentService.appRoot, this.configuration.env.userExtensionsHome] }; const telemetryService = instantiationService.createInstance(TelemetryService, config);