From bfc9b536a24db89fb702976b100f586c0f455af0 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 17 Aug 2016 13:03:55 +0200 Subject: [PATCH] align more stuff --- src/vs/code/electron-main/window.ts | 13 ++++++------- src/vs/code/electron-main/windows.ts | 5 ----- src/vs/platform/workspace/common/workspace.ts | 6 ------ .../workbench/electron-browser/bootstrap/index.js | 4 ++-- src/vs/workbench/electron-browser/workbench.ts | 6 ++++-- 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 5c43957747d..8b6f26a28c7 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -90,21 +90,20 @@ export interface IPath { export interface IWindowConfiguration extends ICommandLineArguments { version: string; - appName: string; - applicationName: string; appSettingsHome: string; - appSettingsPath: string; - appKeybindingsPath: string; userExtensionsHome: string; appRoot: string; - isBuilt: boolean; + + // Used to configure the workbench when opening + workspacePath?: string; recentFiles: string[]; recentFolders: string[]; - workspacePath?: string; filesToOpen?: IPath[]; filesToCreate?: IPath[]; filesToDiff?: IPath[]; extensionsToInstall: string[]; + + // Used to send the main process environment over to the renderer userEnv: IProcessEnvironment; } @@ -359,7 +358,7 @@ export class VSCodeWindow { this._win.loadURL(this.getUrl(config)); // Make window visible if it did not open in N seconds because this indicates an error - if (!config.isBuilt) { + if (!this.envService.isBuilt) { this.showTimeoutHandle = setTimeout(() => { if (this._win && !this._win.isVisible() && !this._win.isMinimized()) { this._win.show(); diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index f60bf6739f3..41554b10fd1 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -732,15 +732,10 @@ export class WindowsManager implements IWindowsService { configuration.filesToCreate = filesToCreate; configuration.filesToDiff = filesToDiff; configuration.extensionsToInstall = extensionsToInstall; - configuration.appName = this.envService.product.nameLong; - configuration.applicationName = this.envService.product.applicationName; configuration.appRoot = this.envService.appRoot; configuration.version = pkg.version; configuration.appSettingsHome = this.envService.appSettingsHome; - configuration.appSettingsPath = this.envService.appSettingsPath; - configuration.appKeybindingsPath = this.envService.appKeybindingsPath; configuration.userExtensionsHome = this.envService.userExtensionsHome; - configuration.isBuilt = this.envService.isBuilt; 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 a4aa302cb68..ac68349ae49 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -85,17 +85,11 @@ export interface IConfiguration { } export interface IEnvironment { - appName: string; appRoot: string; - isBuilt: boolean; - - applicationName: string; version: string; appSettingsHome: string; - appSettingsPath: string; - appKeybindingsPath: string; disableExtensions: boolean; diff --git a/src/vs/workbench/electron-browser/bootstrap/index.js b/src/vs/workbench/electron-browser/bootstrap/index.js index e4ef117c7da..0ef54b4543b 100644 --- a/src/vs/workbench/electron-browser/bootstrap/index.js +++ b/src/vs/workbench/electron-browser/bootstrap/index.js @@ -104,7 +104,7 @@ function main() { const webFrame = require('electron').webFrame; const args = parseURLQueryArgs(); const configuration = JSON.parse(args['config'] || '{}') || {}; - const enableDeveloperTools = !configuration.isBuilt || !!configuration.extensionDevelopmentPath; + const enableDeveloperTools = process.env['VSCODE_DEV'] || !!configuration.extensionDevelopmentPath; // Correctly inherit the parent's environment assign(process.env, configuration.userEnv); @@ -167,7 +167,7 @@ function main() { } window.MonacoEnvironment = {}; - + const timers = window.MonacoEnvironment.timers = { start: new Date() }; diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index a90a36884c4..400d513af4c 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -68,6 +68,7 @@ import {IStatusbarService} from 'vs/platform/statusbar/common/statusbar'; import {IMenuService} from 'vs/platform/actions/common/actions'; import {MenuService} from 'vs/platform/actions/common/menuService'; import {IContextMenuService} from 'vs/platform/contextview/browser/contextView'; +import {IEnvironmentService} from 'vs/platform/environment/common/environment'; export const MessagesVisibleContext = new RawContextKey('globalMessageVisible', false); export const EditorsVisibleContext = new RawContextKey('editorIsOpen', false); @@ -140,7 +141,8 @@ export class Workbench implements IPartService { @IStorageService private storageService: IStorageService, @ILifecycleService private lifecycleService: ILifecycleService, @IMessageService private messageService: IMessageService, - @IThreadService private threadService: IThreadService + @IThreadService private threadService: IThreadService, + @IEnvironmentService private environmentService: IEnvironmentService ) { // Validate params @@ -229,7 +231,7 @@ export class Workbench implements IPartService { // Load Viewlet const viewletRegistry = (Registry.as(ViewletExtensions.Viewlets)); let viewletId = viewletRegistry.getDefaultViewletId(); - if (!this.workbenchParams.configuration.env.isBuilt) { + if (!this.environmentService.isBuilt) { viewletId = this.storageService.get(SidebarPart.activeViewletSettingsKey, StorageScope.WORKSPACE, viewletRegistry.getDefaultViewletId()); // help developers and restore last view } -- GitLab