remove more stuff from IWindowConfiguration

This commit is contained in:
Benjamin Pasero 2016-08-17 12:45:54 +02:00
parent 8c049b9bf4
commit 413a1db68b
4 changed files with 5 additions and 82 deletions

View file

@ -89,22 +89,15 @@ export interface IPath {
} }
export interface IWindowConfiguration extends ICommandLineArguments { export interface IWindowConfiguration extends ICommandLineArguments {
execPath: string;
version: string; version: string;
appName: string; appName: string;
applicationName: string; applicationName: string;
darwinBundleIdentifier: string;
appSettingsHome: string; appSettingsHome: string;
appSettingsPath: string; appSettingsPath: string;
appKeybindingsPath: string; appKeybindingsPath: string;
userExtensionsHome: string; userExtensionsHome: string;
mainIPCHandle: string;
sharedIPCHandle: string;
appRoot: string; appRoot: string;
isBuilt: boolean; isBuilt: boolean;
commitHash: string;
updateFeedUrl: string;
updateChannel: string;
recentFiles: string[]; recentFiles: string[];
recentFolders: string[]; recentFolders: string[];
workspacePath?: string; workspacePath?: string;
@ -112,26 +105,7 @@ export interface IWindowConfiguration extends ICommandLineArguments {
filesToCreate?: IPath[]; filesToCreate?: IPath[];
filesToDiff?: IPath[]; filesToDiff?: IPath[];
extensionsToInstall: string[]; 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; userEnv: IProcessEnvironment;
aiConfig: {
key: string;
asimovKey: string;
};
sendASmile: {
reportIssueUrl: string,
requestFeatureUrl: string
};
} }
export class VSCodeWindow { export class VSCodeWindow {

View file

@ -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 { 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 let configuration: IWindowConfiguration = mixin({}, cli); // inherit all properties from CLI
configuration.execPath = process.execPath;
configuration.workspacePath = workspacePath; configuration.workspacePath = workspacePath;
configuration.filesToOpen = filesToOpen; configuration.filesToOpen = filesToOpen;
configuration.filesToCreate = filesToCreate; configuration.filesToCreate = filesToCreate;
@ -735,29 +734,13 @@ export class WindowsManager implements IWindowsService {
configuration.extensionsToInstall = extensionsToInstall; configuration.extensionsToInstall = extensionsToInstall;
configuration.appName = this.envService.product.nameLong; configuration.appName = this.envService.product.nameLong;
configuration.applicationName = this.envService.product.applicationName; configuration.applicationName = this.envService.product.applicationName;
configuration.darwinBundleIdentifier = this.envService.product.darwinBundleIdentifier;
configuration.appRoot = this.envService.appRoot; configuration.appRoot = this.envService.appRoot;
configuration.version = pkg.version; configuration.version = pkg.version;
configuration.commitHash = this.envService.product.commit;
configuration.appSettingsHome = this.envService.appSettingsHome; configuration.appSettingsHome = this.envService.appSettingsHome;
configuration.appSettingsPath = this.envService.appSettingsPath; configuration.appSettingsPath = this.envService.appSettingsPath;
configuration.appKeybindingsPath = this.envService.appKeybindingsPath; configuration.appKeybindingsPath = this.envService.appKeybindingsPath;
configuration.userExtensionsHome = this.envService.userExtensionsHome; 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.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; configuration.userEnv = userEnv;
const recents = this.getRecentlyOpenedPaths(workspacePath, filesToOpen); const recents = this.getRecentlyOpenedPaths(workspacePath, filesToOpen);

View file

@ -88,31 +88,10 @@ export interface IEnvironment {
appName: string; appName: string;
appRoot: string; appRoot: string;
isBuilt: boolean; isBuilt: boolean;
execPath: string;
applicationName: string; applicationName: string;
darwinBundleIdentifier: string;
version: 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; appSettingsHome: string;
appSettingsPath: string; appSettingsPath: string;
@ -123,22 +102,9 @@ export interface IEnvironment {
logExtensionHostCommunication: boolean; logExtensionHostCommunication: boolean;
userExtensionsHome: string; userExtensionsHome: string;
sharedIPCHandle: string;
extensionDevelopmentPath: string; extensionDevelopmentPath: string;
extensionTestsPath: string; extensionTestsPath: string;
recentFiles: string[]; recentFiles: string[];
recentFolders: string[]; recentFolders: string[];
enableTelemetry: boolean;
aiConfig: {
key: string;
asimovKey: string;
};
sendASmile: {
reportIssueUrl: string,
requestFeatureUrl: string
};
} }

View file

@ -152,9 +152,9 @@ export class WorkbenchShell {
const [instantiationService, serviceCollection] = this.initServiceCollection(); const [instantiationService, serviceCollection] = this.initServiceCollection();
//crash reporting //crash reporting
if (!!this.configuration.env.crashReporter) { if (!!product.crashReporter) {
const crashReporter = instantiationService.createInstance(CrashReporter, this.configuration.env.version, this.configuration.env.commitHash); const crashReporter = instantiationService.createInstance(CrashReporter, pkg.version, product.commit);
crashReporter.start(this.configuration.env.crashReporter); crashReporter.start(product.crashReporter);
} }
// Workbench // Workbench
@ -244,7 +244,7 @@ export class WorkbenchShell {
serviceCollection.set(IStorageService, this.storageService); serviceCollection.set(IStorageService, this.storageService);
// Telemetry // 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<ITelemetryAppenderChannel>(sharedProcess.then(c => c.getChannel('telemetryAppender'))); const channel = getDelayedChannel<ITelemetryAppenderChannel>(sharedProcess.then(c => c.getChannel('telemetryAppender')));
const commit = product.commit; const commit = product.commit;
const version = pkg.version; const version = pkg.version;
@ -252,7 +252,7 @@ export class WorkbenchShell {
const config: ITelemetryServiceConfig = { const config: ITelemetryServiceConfig = {
appender: new TelemetryAppenderClient(channel), appender: new TelemetryAppenderClient(channel),
commonProperties: resolveWorkbenchCommonProperties(this.storageService, commit, version), 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); const telemetryService = instantiationService.createInstance(TelemetryService, config);