diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 289c61b7d88..e805498205d 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -89,20 +89,21 @@ export interface IPath { } export interface IWindowConfiguration extends ICommandLineArguments { + appRoot: string; + execPath: string; + + userEnv: IProcessEnvironment; - // Used to configure the workbench when opening workspacePath?: string; + recentFiles: string[]; recentFolders: string[]; + filesToOpen?: IPath[]; filesToCreate?: IPath[]; filesToDiff?: IPath[]; - extensionsToInstall: string[]; - // Used to send the main process environment over to the renderer - appRoot: string; - execPath: string; - userEnv: IProcessEnvironment; + extensionsToInstall: string[]; } export class VSCodeWindow { diff --git a/src/vs/workbench/common/options.ts b/src/vs/workbench/common/options.ts index 02c6033da83..0f8a0b614af 100644 --- a/src/vs/workbench/common/options.ts +++ b/src/vs/workbench/common/options.ts @@ -46,6 +46,12 @@ export interface IOptions { */ editor?: IEditorOptions; + /** + * Recent files and folders + */ + recentFiles?: string[]; + recentFolders?: string[]; + /** * The global application settings if any. */ diff --git a/src/vs/workbench/electron-browser/actions.ts b/src/vs/workbench/electron-browser/actions.ts index 67e340e4ae1..8e0feb63e8c 100644 --- a/src/vs/workbench/electron-browser/actions.ts +++ b/src/vs/workbench/electron-browser/actions.ts @@ -382,8 +382,8 @@ export class OpenRecentAction extends Action { } public run(): TPromise { - const recentFolders = this.contextService.getConfiguration().env.recentFolders; - const recentFiles = this.contextService.getConfiguration().env.recentFiles; + const recentFolders = this.contextService.getOptions().recentFolders; + const recentFiles = this.contextService.getOptions().recentFiles; const folderPicks: IPickOpenEntry[] = recentFolders.map((p, index) => { return { diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index 59daeb13aff..66b06436453 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -19,6 +19,7 @@ import {EventService} from 'vs/platform/event/common/eventService'; import {WorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService'; import {IWorkspace} from 'vs/platform/workspace/common/workspace'; import {ConfigurationService} from 'vs/workbench/services/configuration/node/configurationService'; +import {IProcessEnvironment} from 'vs/code/electron-main/env'; import {EnvironmentService, IEnvironment} from 'vs/platform/environment/node/environmentService'; import path = require('path'); import fs = require('fs'); @@ -45,15 +46,25 @@ export interface IPath { columnNumber?: number; } -export interface IConfiguration extends IEnvironment { +export interface IWindowConfiguration extends IEnvironment { + appRoot: string; + execPath: string; + + userEnv: IProcessEnvironment; + workspacePath?: string; + + recentFiles?: string[]; + recentFolders?: string[]; + filesToOpen?: IPath[]; filesToCreate?: IPath[]; filesToDiff?: IPath[]; + extensionsToInstall?: string[]; } -export function startup(configuration: IConfiguration, globalSettings: IGlobalSettings): winjs.TPromise { +export function startup(configuration: IWindowConfiguration, globalSettings: IGlobalSettings): winjs.TPromise { // Shell Options const filesToOpen = configuration.filesToOpen && configuration.filesToOpen.length ? toInputs(configuration.filesToOpen) : null; @@ -61,11 +72,13 @@ export function startup(configuration: IConfiguration, globalSettings: IGlobalSe const filesToDiff = configuration.filesToDiff && configuration.filesToDiff.length ? toInputs(configuration.filesToDiff) : null; const shellOptions: IOptions = { singleFileMode: !configuration.workspacePath, - filesToOpen: filesToOpen, - filesToCreate: filesToCreate, - filesToDiff: filesToDiff, + filesToOpen, + filesToCreate, + filesToDiff, + recentFiles: configuration.recentFiles, + recentFolders: configuration.recentFolders, extensionsToInstall: configuration.extensionsToInstall, - globalSettings: globalSettings + globalSettings }; if (configuration.performance) {