decouple execPath from parsedArgs

This commit is contained in:
Joao Moreno
2016-08-19 15:48:38 +02:00
parent 3e601b5bd7
commit bb25b46ff4
6 changed files with 12 additions and 19 deletions

View File

@@ -10,7 +10,6 @@ import * as path from 'path';
import { parseArgs, ParsedArgs } from 'vs/code/node/argv';
import { TPromise } from 'vs/base/common/winjs.base';
import { sequence } from 'vs/base/common/async';
import * as objects from 'vs/base/common/objects';
import { IPager } from 'vs/base/common/paging';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
@@ -146,7 +145,7 @@ const eventPrefix = 'monacoworkbench';
export function main(argv: ParsedArgs): TPromise<void> {
const services = new ServiceCollection();
services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, objects.assign(parseArgs(process.argv), { execPath: process.execPath })));
services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, parseArgs(process.argv), process.execPath));
const instantiationService: IInstantiationService = new InstantiationService(services);

View File

@@ -6,7 +6,6 @@
import * as fs from 'fs';
import * as platform from 'vs/base/common/platform';
import product from 'vs/platform/product';
import * as objects from 'vs/base/common/objects';
import pkg from 'vs/platform/package';
import { serve, Server, connect } from 'vs/base/parts/ipc/node/ipc.net';
import { TPromise } from 'vs/base/common/winjs.base';
@@ -59,7 +58,7 @@ function main(server: Server): void {
const services = new ServiceCollection();
services.set(IEventService, new SyncDescriptor(EventService));
services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, objects.assign(parseArgs(process.argv), { execPath: process.execPath })));
services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, parseArgs(process.argv), process.execPath));
services.set(IConfigurationService, new SyncDescriptor(NodeConfigurationService));
services.set(IRequestService, new SyncDescriptor(RequestService));