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 {
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 {

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 {
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);

View file

@ -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
};
}

View file

@ -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<ITelemetryAppenderChannel>(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);