fix last use of getConfiguration()

This commit is contained in:
Benjamin Pasero 2016-08-17 15:47:25 +02:00
parent d1491f4ac5
commit e7a371a1dc
4 changed files with 34 additions and 14 deletions

View file

@ -89,20 +89,21 @@ export interface IPath {
} }
export interface IWindowConfiguration extends ICommandLineArguments { export interface IWindowConfiguration extends ICommandLineArguments {
appRoot: string;
execPath: string;
userEnv: IProcessEnvironment;
// Used to configure the workbench when opening
workspacePath?: string; workspacePath?: string;
recentFiles: string[]; recentFiles: string[];
recentFolders: string[]; recentFolders: string[];
filesToOpen?: IPath[]; filesToOpen?: IPath[];
filesToCreate?: IPath[]; filesToCreate?: IPath[];
filesToDiff?: IPath[]; filesToDiff?: IPath[];
extensionsToInstall: string[];
// Used to send the main process environment over to the renderer extensionsToInstall: string[];
appRoot: string;
execPath: string;
userEnv: IProcessEnvironment;
} }
export class VSCodeWindow { export class VSCodeWindow {

View file

@ -46,6 +46,12 @@ export interface IOptions {
*/ */
editor?: IEditorOptions; editor?: IEditorOptions;
/**
* Recent files and folders
*/
recentFiles?: string[];
recentFolders?: string[];
/** /**
* The global application settings if any. * The global application settings if any.
*/ */

View file

@ -382,8 +382,8 @@ export class OpenRecentAction extends Action {
} }
public run(): TPromise<boolean> { public run(): TPromise<boolean> {
const recentFolders = this.contextService.getConfiguration().env.recentFolders; const recentFolders = this.contextService.getOptions().recentFolders;
const recentFiles = this.contextService.getConfiguration().env.recentFiles; const recentFiles = this.contextService.getOptions().recentFiles;
const folderPicks: IPickOpenEntry[] = recentFolders.map((p, index) => { const folderPicks: IPickOpenEntry[] = recentFolders.map((p, index) => {
return { return {

View file

@ -19,6 +19,7 @@ import {EventService} from 'vs/platform/event/common/eventService';
import {WorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService'; import {WorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
import {IWorkspace} from 'vs/platform/workspace/common/workspace'; import {IWorkspace} from 'vs/platform/workspace/common/workspace';
import {ConfigurationService} from 'vs/workbench/services/configuration/node/configurationService'; 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 {EnvironmentService, IEnvironment} from 'vs/platform/environment/node/environmentService';
import path = require('path'); import path = require('path');
import fs = require('fs'); import fs = require('fs');
@ -45,15 +46,25 @@ export interface IPath {
columnNumber?: number; columnNumber?: number;
} }
export interface IConfiguration extends IEnvironment { export interface IWindowConfiguration extends IEnvironment {
appRoot: string;
execPath: string;
userEnv: IProcessEnvironment;
workspacePath?: string; workspacePath?: string;
recentFiles?: string[];
recentFolders?: string[];
filesToOpen?: IPath[]; filesToOpen?: IPath[];
filesToCreate?: IPath[]; filesToCreate?: IPath[];
filesToDiff?: IPath[]; filesToDiff?: IPath[];
extensionsToInstall?: string[]; extensionsToInstall?: string[];
} }
export function startup(configuration: IConfiguration, globalSettings: IGlobalSettings): winjs.TPromise<void> { export function startup(configuration: IWindowConfiguration, globalSettings: IGlobalSettings): winjs.TPromise<void> {
// Shell Options // Shell Options
const filesToOpen = configuration.filesToOpen && configuration.filesToOpen.length ? toInputs(configuration.filesToOpen) : null; 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 filesToDiff = configuration.filesToDiff && configuration.filesToDiff.length ? toInputs(configuration.filesToDiff) : null;
const shellOptions: IOptions = { const shellOptions: IOptions = {
singleFileMode: !configuration.workspacePath, singleFileMode: !configuration.workspacePath,
filesToOpen: filesToOpen, filesToOpen,
filesToCreate: filesToCreate, filesToCreate,
filesToDiff: filesToDiff, filesToDiff,
recentFiles: configuration.recentFiles,
recentFolders: configuration.recentFolders,
extensionsToInstall: configuration.extensionsToInstall, extensionsToInstall: configuration.extensionsToInstall,
globalSettings: globalSettings globalSettings
}; };
if (configuration.performance) { if (configuration.performance) {