let execPath be a property of IEnvironmentService
This commit is contained in:
parent
8ddc5f3262
commit
a7da0430da
|
@ -105,6 +105,7 @@ export interface IWindowConfiguration extends ICommandLineArguments {
|
|||
|
||||
// Used to send the main process environment over to the renderer
|
||||
appRoot: string;
|
||||
execPath: string;
|
||||
userEnv: IProcessEnvironment;
|
||||
}
|
||||
|
||||
|
|
|
@ -732,6 +732,7 @@ export class WindowsManager implements IWindowsService {
|
|||
configuration.filesToDiff = filesToDiff;
|
||||
configuration.extensionsToInstall = extensionsToInstall;
|
||||
configuration.appRoot = this.envService.appRoot;
|
||||
configuration.execPath = process.execPath;
|
||||
configuration.appSettingsHome = this.envService.appSettingsHome;
|
||||
configuration.userExtensionsHome = this.envService.userExtensionsHome;
|
||||
configuration.userEnv = userEnv;
|
||||
|
|
|
@ -10,6 +10,7 @@ export const IEnvironmentService = createDecorator<IEnvironmentService>('environ
|
|||
export interface IEnvironmentService {
|
||||
_serviceBrand: any;
|
||||
|
||||
execPath: string;
|
||||
appRoot: string;
|
||||
|
||||
userHome: string;
|
||||
|
|
|
@ -11,6 +11,10 @@ import * as path from 'path';
|
|||
import {ParsedArgs} from 'vs/code/node/argv';
|
||||
import URI from 'vs/base/common/uri';
|
||||
|
||||
export interface IEnvironment extends ParsedArgs {
|
||||
execPath: string;
|
||||
}
|
||||
|
||||
export class EnvironmentService implements IEnvironmentService {
|
||||
|
||||
_serviceBrand: any;
|
||||
|
@ -18,6 +22,8 @@ export class EnvironmentService implements IEnvironmentService {
|
|||
private _appRoot: string;
|
||||
get appRoot(): string { return this._appRoot; }
|
||||
|
||||
get execPath(): string { return this.args.execPath; }
|
||||
|
||||
private _userHome: string;
|
||||
get userHome(): string { return this._userHome; }
|
||||
|
||||
|
@ -52,7 +58,7 @@ export class EnvironmentService implements IEnvironmentService {
|
|||
private _debugBrkFileWatcherPort: number;
|
||||
get debugBrkFileWatcherPort(): number { return this._debugBrkFileWatcherPort; }
|
||||
|
||||
constructor(private args: ParsedArgs) {
|
||||
constructor(private args: IEnvironment) {
|
||||
this._appRoot = path.dirname(URI.parse(require.toUrl('')).fsPath);
|
||||
this._userDataPath = args['user-data-dir'] || paths.getDefaultUserDataPath(process.platform);
|
||||
|
||||
|
|
|
@ -10,13 +10,12 @@ import { TestInstantiationService } from 'vs/test/utils/instantiationTestUtils';
|
|||
import EventEmitter = require('vs/base/common/eventEmitter');
|
||||
import Paths = require('vs/base/common/paths');
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {NullTelemetryService, ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
|
||||
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
|
||||
import Storage = require('vs/workbench/common/storage');
|
||||
import {EditorInputEvent, IEditorGroup} from 'vs/workbench/common/editor';
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import Types = require('vs/base/common/types');
|
||||
import Objects = require('vs/base/common/objects');
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import http = require('vs/base/common/http');
|
||||
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
|
||||
import {IContent, IStat} from 'vs/platform/configuration/common/configurationService';
|
||||
import {IStorageService, StorageScope} from 'vs/platform/storage/common/storage';
|
||||
|
@ -56,7 +55,7 @@ export const TestConfiguration: IConfiguration = {
|
|||
env: Object.create(null)
|
||||
};
|
||||
|
||||
export const TestEnvironmentService = new EnvironmentService(parseArgs(process.argv));
|
||||
export const TestEnvironmentService = new EnvironmentService(Objects.assign(parseArgs(process.argv), { execPath: process.execPath }));
|
||||
|
||||
export class TestContextService implements WorkspaceContextService.IWorkspaceContextService {
|
||||
public _serviceBrand: any;
|
||||
|
|
|
@ -16,11 +16,10 @@ import uri from 'vs/base/common/uri';
|
|||
import strings = require('vs/base/common/strings');
|
||||
import {IResourceInput} from 'vs/platform/editor/common/editor';
|
||||
import {EventService} from 'vs/platform/event/common/eventService';
|
||||
import {ParsedArgs} from 'vs/code/node/argv';
|
||||
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 {EnvironmentService} from 'vs/platform/environment/node/environmentService';
|
||||
import {EnvironmentService, IEnvironment} from 'vs/platform/environment/node/environmentService';
|
||||
import path = require('path');
|
||||
import fs = require('fs');
|
||||
import gracefulFs = require('graceful-fs');
|
||||
|
@ -46,7 +45,7 @@ export interface IPath {
|
|||
columnNumber?: number;
|
||||
}
|
||||
|
||||
export interface IConfiguration extends ParsedArgs {
|
||||
export interface IConfiguration extends IEnvironment {
|
||||
workspacePath?: string;
|
||||
filesToOpen?: IPath[];
|
||||
filesToCreate?: IPath[];
|
||||
|
@ -128,7 +127,7 @@ function getWorkspace(workspacePath: string): IWorkspace {
|
|||
};
|
||||
}
|
||||
|
||||
function openWorkbench(environment: ParsedArgs, workspace: IWorkspace, configuration: IConfiguration, options: IOptions): winjs.TPromise<void> {
|
||||
function openWorkbench(environment: IEnvironment, workspace: IWorkspace, configuration: IConfiguration, options: IOptions): winjs.TPromise<void> {
|
||||
const eventService = new EventService();
|
||||
const environmentService = new EnvironmentService(environment);
|
||||
const contextService = new WorkspaceContextService(eventService, workspace, configuration, options);
|
||||
|
|
|
@ -37,7 +37,7 @@ import model = require('vs/workbench/parts/debug/common/debugModel');
|
|||
import {DebugStringEditorInput} from 'vs/workbench/parts/debug/browser/debugEditorInputs';
|
||||
import viewmodel = require('vs/workbench/parts/debug/common/debugViewModel');
|
||||
import debugactions = require('vs/workbench/parts/debug/browser/debugActions');
|
||||
import {ConfigurationManager} from 'vs/workbench/parts/debug/electron-browser/debugConfigurationManager';
|
||||
import {ConfigurationManager} from 'vs/workbench/parts/debug/node/debugConfigurationManager';
|
||||
import {Source} from 'vs/workbench/parts/debug/common/debugSource';
|
||||
import {ITaskService, TaskEvent, TaskType, TaskServiceEvents, ITaskSummary} from 'vs/workbench/parts/tasks/common/taskService';
|
||||
import {TaskError, TaskErrors} from 'vs/workbench/parts/tasks/common/taskSystem';
|
||||
|
|
|
@ -29,8 +29,9 @@ import {Adapter} from 'vs/workbench/parts/debug/node/debugAdapter';
|
|||
import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
|
||||
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
|
||||
import {IQuickOpenService} from 'vs/workbench/services/quickopen/common/quickOpenService';
|
||||
import {ConfigVariables} from 'vs/workbench/parts/lib/electron-browser/configVariables';
|
||||
import {ConfigVariables} from 'vs/workbench/parts/lib/node/configVariables';
|
||||
import {ISystemVariables} from 'vs/base/common/parsers';
|
||||
import {IEnvironmentService} from 'vs/platform/environment/common/environment';
|
||||
|
||||
// debuggers extension point
|
||||
export const debuggersExtPoint = extensionsRegistry.ExtensionsRegistry.registerExtensionPoint<debug.IRawAdapter[]>('debuggers', {
|
||||
|
@ -183,10 +184,11 @@ export class ConfigurationManager implements debug.IConfigurationManager {
|
|||
@ITelemetryService private telemetryService: ITelemetryService,
|
||||
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
|
||||
@IConfigurationService private configurationService: IConfigurationService,
|
||||
@IEnvironmentService private environmentService: IEnvironmentService,
|
||||
@IQuickOpenService private quickOpenService: IQuickOpenService,
|
||||
@ICommandService private commandService: ICommandService
|
||||
) {
|
||||
this.systemVariables = this.contextService.getWorkspace() ? new ConfigVariables(this.configurationService, this.editorService, this.contextService) : null;
|
||||
this.systemVariables = this.contextService.getWorkspace() ? new ConfigVariables(this.configurationService, this.editorService, this.contextService, this.environmentService) : null;
|
||||
this._onDidConfigurationChange = new Emitter<string>();
|
||||
this.setConfiguration(configName);
|
||||
this.adapters = [];
|
|
@ -23,7 +23,6 @@ import { RawGitService, DelayedRawGitService } from 'vs/workbench/parts/git/node
|
|||
import URI from 'vs/base/common/uri';
|
||||
import { spawn, exec } from 'child_process';
|
||||
import { join } from 'path';
|
||||
import { remote } from 'electron';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { readdir } from 'vs/base/node/pfs';
|
||||
|
||||
|
@ -147,7 +146,7 @@ class DisabledRawGitService extends RawGitService {
|
|||
}
|
||||
}
|
||||
|
||||
function createRemoteRawGitService(gitPath: string, workspaceRoot: string, encoding: string, verbose: boolean): IRawGitService {
|
||||
function createRemoteRawGitService(gitPath: string, execPath: string, workspaceRoot: string, encoding: string, verbose: boolean): IRawGitService {
|
||||
const promise = TPromise.timeout(0) // free event loop cos finding git costs
|
||||
.then(() => findGit(gitPath))
|
||||
.then(({ path, version }) => {
|
||||
|
@ -156,7 +155,7 @@ function createRemoteRawGitService(gitPath: string, workspaceRoot: string, encod
|
|||
{
|
||||
serverName: 'Git',
|
||||
timeout: 1000 * 60,
|
||||
args: [path, workspaceRoot, encoding, remote.process.execPath, version],
|
||||
args: [path, workspaceRoot, encoding, execPath, version],
|
||||
env: {
|
||||
ATOM_SHELL_INTERNAL_RUN_AS_NODE: 1,
|
||||
PIPE_LOGGING: 'true',
|
||||
|
@ -178,11 +177,11 @@ interface IRawGitServiceBootstrap {
|
|||
createRawGitService(gitPath: string, workspaceRoot: string, defaultEncoding: string, exePath: string, version: string): TPromise<IRawGitService>;
|
||||
}
|
||||
|
||||
function createRawGitService(gitPath: string, workspaceRoot: string, encoding: string, verbose: boolean): IRawGitService {
|
||||
function createRawGitService(gitPath: string, execPath: string, workspaceRoot: string, encoding: string, verbose: boolean): IRawGitService {
|
||||
const promise = new TPromise<IRawGitService>((c, e) => {
|
||||
require(['vs/workbench/parts/git/node/rawGitServiceBootstrap'], ({ createRawGitService }: IRawGitServiceBootstrap) => {
|
||||
findGit(gitPath)
|
||||
.then(({ path, version }) => createRawGitService(path, workspaceRoot, encoding, remote.process.execPath, version))
|
||||
.then(({ path, version }) => createRawGitService(path, workspaceRoot, encoding, execPath, version))
|
||||
.done(c, e);
|
||||
}, e);
|
||||
});
|
||||
|
@ -223,9 +222,9 @@ export class ElectronGitService extends GitService {
|
|||
const verbose = !environmentService.isBuilt || environmentService.verbose;
|
||||
|
||||
if (ElectronGitService.USE_REMOTE_PROCESS_SERVICE) {
|
||||
raw = createRemoteRawGitService(gitPath, workspaceRoot, encoding, verbose);
|
||||
raw = createRemoteRawGitService(gitPath, environmentService.execPath, workspaceRoot, encoding, verbose);
|
||||
} else {
|
||||
raw = createRawGitService(gitPath, workspaceRoot, encoding, verbose);
|
||||
raw = createRawGitService(gitPath, environmentService.execPath, workspaceRoot, encoding, verbose);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,10 +10,18 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
|||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IWorkspaceContextService } from 'vs/workbench/services/workspace/common/contextService';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
|
||||
export class ConfigVariables extends SystemVariables {
|
||||
constructor(private configurationService: IConfigurationService, editorService: IWorkbenchEditorService, contextService: IWorkspaceContextService, workspaceRoot: URI = null, envVariables: { [key: string]: string } = process.env) {
|
||||
super(editorService, contextService, workspaceRoot, envVariables);
|
||||
constructor(
|
||||
private configurationService: IConfigurationService,
|
||||
editorService: IWorkbenchEditorService,
|
||||
contextService: IWorkspaceContextService,
|
||||
environmentService: IEnvironmentService,
|
||||
workspaceRoot: URI = null,
|
||||
envVariables: { [key: string]: string } = process.env
|
||||
) {
|
||||
super(editorService, contextService, environmentService, workspaceRoot, envVariables);
|
||||
}
|
||||
|
||||
protected resolveString(value: string): string {
|
|
@ -12,8 +12,7 @@ import * as WorkbenchEditorCommon from 'vs/workbench/common/editor';
|
|||
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IWorkspaceContextService } from 'vs/workbench/services/workspace/common/contextService';
|
||||
|
||||
import { remote } from 'electron';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
|
||||
export class SystemVariables extends AbstractSystemVariables {
|
||||
private _workspaceRoot: string;
|
||||
|
@ -23,6 +22,7 @@ export class SystemVariables extends AbstractSystemVariables {
|
|||
constructor(
|
||||
private editorService: IWorkbenchEditorService,
|
||||
contextService: IWorkspaceContextService,
|
||||
environmentService: IEnvironmentService,
|
||||
workspaceRoot: URI = null,
|
||||
envVariables: { [key: string]: string } = process.env
|
||||
) {
|
||||
|
@ -32,7 +32,7 @@ export class SystemVariables extends AbstractSystemVariables {
|
|||
fsPath = workspaceRoot ? workspaceRoot.fsPath : contextService.getWorkspace().resource.fsPath;
|
||||
}
|
||||
this._workspaceRoot = Paths.normalize(fsPath, true);
|
||||
this._execPath = remote.process.execPath;
|
||||
this._execPath = environmentService.execPath;
|
||||
Object.keys(envVariables).forEach(key => {
|
||||
this[`env.${key}`] = envVariables[key];
|
||||
});
|
|
@ -7,8 +7,9 @@
|
|||
import * as assert from 'assert';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import * as Platform from 'vs/base/common/platform';
|
||||
import { ConfigVariables } from 'vs/workbench/parts/lib/electron-browser/configVariables';
|
||||
import { ConfigVariables } from 'vs/workbench/parts/lib/node/configVariables';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import {TestEnvironmentService} from 'vs/test/utils/servicesTestUtils';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
|
||||
suite('ConfigVariables tests', () => {
|
||||
|
@ -25,7 +26,7 @@ suite('ConfigVariables tests', () => {
|
|||
}
|
||||
});
|
||||
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
assert.strictEqual(systemVariables.resolve('abc ${config.editor.fontFamily} xyz'), 'abc foo xyz');
|
||||
});
|
||||
|
||||
|
@ -42,7 +43,7 @@ suite('ConfigVariables tests', () => {
|
|||
}
|
||||
});
|
||||
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
assert.strictEqual(systemVariables.resolve('abc ${config.editor.fontFamily} ${config.terminal.integrated.fontFamily} xyz'), 'abc foo bar xyz');
|
||||
});
|
||||
test('SystemVariables: substitute one env variable', () => {
|
||||
|
@ -59,7 +60,7 @@ suite('ConfigVariables tests', () => {
|
|||
});
|
||||
|
||||
let envVariables: { [key: string]: string } = { key1: 'Value for Key1', key2: 'Value for Key2' };
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, URI.parse('file:///VSCode/workspaceLocation'), envVariables);
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation'), envVariables);
|
||||
if (Platform.isWindows) {
|
||||
assert.strictEqual(systemVariables.resolve('abc ${config.editor.fontFamily} ${workspaceRoot} ${env.key1} xyz'), 'abc foo \\VSCode\\workspaceLocation Value for Key1 xyz');
|
||||
} else {
|
||||
|
@ -81,7 +82,7 @@ suite('ConfigVariables tests', () => {
|
|||
});
|
||||
|
||||
let envVariables: { [key: string]: string } = { key1: 'Value for Key1', key2: 'Value for Key2' };
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, URI.parse('file:///VSCode/workspaceLocation'), envVariables);
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation'), envVariables);
|
||||
if (Platform.isWindows) {
|
||||
assert.strictEqual(systemVariables.resolve('${config.editor.fontFamily} ${config.terminal.integrated.fontFamily} ${workspaceRoot} - ${workspaceRoot} ${env.key1} - ${env.key2}'), 'foo bar \\VSCode\\workspaceLocation - \\VSCode\\workspaceLocation Value for Key1 - Value for Key2');
|
||||
} else {
|
||||
|
@ -115,7 +116,7 @@ suite('ConfigVariables tests', () => {
|
|||
}
|
||||
});
|
||||
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
assert.strictEqual(systemVariables.resolve('abc ${config.editor.fontFamily} ${config.editor.lineNumbers} ${config.editor.insertSpaces} ${config.json.schemas[0].fileMatch[1]} xyz'), 'abc foo 123 false {{/myOtherfile}} xyz');
|
||||
});
|
||||
});
|
|
@ -7,12 +7,13 @@
|
|||
import * as assert from 'assert';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import * as Platform from 'vs/base/common/platform';
|
||||
import {TestEnvironmentService} from 'vs/test/utils/servicesTestUtils';
|
||||
|
||||
import { SystemVariables } from 'vs/workbench/parts/lib/electron-browser/systemVariables';
|
||||
import { SystemVariables } from 'vs/workbench/parts/lib/node/systemVariables';
|
||||
|
||||
suite('SystemVariables tests', () => {
|
||||
test('SystemVariables: substitute one', () => {
|
||||
let systemVariables: SystemVariables = new SystemVariables(null, null, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
let systemVariables: SystemVariables = new SystemVariables(null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
if (Platform.isWindows) {
|
||||
assert.strictEqual(systemVariables.resolve('abc ${workspaceRoot} xyz'), 'abc \\VSCode\\workspaceLocation xyz');
|
||||
} else {
|
||||
|
@ -21,7 +22,7 @@ suite('SystemVariables tests', () => {
|
|||
});
|
||||
|
||||
test('SystemVariables: substitute many', () => {
|
||||
let systemVariables: SystemVariables = new SystemVariables(null, null, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
let systemVariables: SystemVariables = new SystemVariables(null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation'));
|
||||
if (Platform.isWindows) {
|
||||
assert.strictEqual(systemVariables.resolve('${workspaceRoot} - ${workspaceRoot}'), '\\VSCode\\workspaceLocation - \\VSCode\\workspaceLocation');
|
||||
} else {
|
||||
|
@ -30,7 +31,7 @@ suite('SystemVariables tests', () => {
|
|||
});
|
||||
test('SystemVariables: substitute one env variable', () => {
|
||||
let envVariables: { [key: string]: string } = { key1: 'Value for Key1', key2: 'Value for Key2' };
|
||||
let systemVariables: SystemVariables = new SystemVariables(null, null, URI.parse('file:///VSCode/workspaceLocation'), envVariables);
|
||||
let systemVariables: SystemVariables = new SystemVariables(null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation'), envVariables);
|
||||
if (Platform.isWindows) {
|
||||
assert.strictEqual(systemVariables.resolve('abc ${workspaceRoot} ${env.key1} xyz'), 'abc \\VSCode\\workspaceLocation Value for Key1 xyz');
|
||||
} else {
|
||||
|
@ -40,7 +41,7 @@ suite('SystemVariables tests', () => {
|
|||
|
||||
test('SystemVariables: substitute many env variable', () => {
|
||||
let envVariables: { [key: string]: string } = { key1: 'Value for Key1', key2: 'Value for Key2' };
|
||||
let systemVariables: SystemVariables = new SystemVariables(null, null, URI.parse('file:///VSCode/workspaceLocation'), envVariables);
|
||||
let systemVariables: SystemVariables = new SystemVariables(null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation'), envVariables);
|
||||
if (Platform.isWindows) {
|
||||
assert.strictEqual(systemVariables.resolve('${workspaceRoot} - ${workspaceRoot} ${env.key1} - ${env.key2}'), '\\VSCode\\workspaceLocation - \\VSCode\\workspaceLocation Value for Key1 - Value for Key2');
|
||||
} else {
|
|
@ -56,7 +56,7 @@ import { IPartService } from 'vs/workbench/services/part/common/partService';
|
|||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IWorkspaceContextService } from 'vs/workbench/services/workspace/common/contextService';
|
||||
|
||||
import { ConfigVariables } from 'vs/workbench/parts/lib/electron-browser/configVariables';
|
||||
import { ConfigVariables } from 'vs/workbench/parts/lib/node/configVariables';
|
||||
import { ITextFileService, EventType } from 'vs/workbench/parts/files/common/files';
|
||||
import { IOutputService, IOutputChannelRegistry, Extensions as OutputExt, IOutputChannel } from 'vs/workbench/parts/output/common/output';
|
||||
|
||||
|
@ -65,9 +65,11 @@ import { ITaskService, TaskServiceEvents } from 'vs/workbench/parts/tasks/common
|
|||
import { templates as taskTemplates } from 'vs/workbench/parts/tasks/common/taskTemplates';
|
||||
|
||||
import { LanguageServiceTaskSystem, LanguageServiceTaskConfiguration } from 'vs/workbench/parts/tasks/common/languageServiceTaskSystem';
|
||||
import * as FileConfig from 'vs/workbench/parts/tasks/electron-browser/processRunnerConfiguration';
|
||||
import { ProcessRunnerSystem } from 'vs/workbench/parts/tasks/electron-browser/processRunnerSystem';
|
||||
import { ProcessRunnerDetector } from 'vs/workbench/parts/tasks/electron-browser/processRunnerDetector';
|
||||
import * as FileConfig from 'vs/workbench/parts/tasks/node/processRunnerConfiguration';
|
||||
import { ProcessRunnerSystem } from 'vs/workbench/parts/tasks/node/processRunnerSystem';
|
||||
import { ProcessRunnerDetector } from 'vs/workbench/parts/tasks/node/processRunnerDetector';
|
||||
|
||||
import {IEnvironmentService} from 'vs/platform/environment/common/environment';
|
||||
|
||||
let $ = Builder.$;
|
||||
|
||||
|
@ -184,7 +186,8 @@ class ConfigureTaskRunnerAction extends Action {
|
|||
constructor(id: string, label: string, @IConfigurationService configurationService: IConfigurationService,
|
||||
@IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService,
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService, @IOutputService outputService: IOutputService,
|
||||
@IMessageService messageService: IMessageService, @IQuickOpenService quickOpenService: IQuickOpenService) {
|
||||
@IMessageService messageService: IMessageService, @IQuickOpenService quickOpenService: IQuickOpenService,
|
||||
@IEnvironmentService private environmentService: IEnvironmentService) {
|
||||
|
||||
super(id, label);
|
||||
this.configurationService = configurationService;
|
||||
|
@ -216,7 +219,7 @@ class ConfigureTaskRunnerAction extends Action {
|
|||
const outputChannel = this.outputService.getChannel(TaskService.OutputChannelId);
|
||||
outputChannel.show();
|
||||
outputChannel.append(nls.localize('ConfigureTaskRunnerAction.autoDetecting', 'Auto detecting tasks for {0}', selection.id) + '\n');
|
||||
let detector = new ProcessRunnerDetector(this.fileService, this.contextService, new ConfigVariables(this.configurationService, this.editorService, this.contextService));
|
||||
let detector = new ProcessRunnerDetector(this.fileService, this.contextService, new ConfigVariables(this.configurationService, this.editorService, this.contextService, this.environmentService));
|
||||
contentPromise = detector.detect(false, selection.id).then((value) => {
|
||||
let config = value.config;
|
||||
if (value.stderr && value.stderr.length > 0) {
|
||||
|
@ -585,7 +588,8 @@ class TaskService extends EventEmitter implements ITaskService {
|
|||
@ITelemetryService telemetryService: ITelemetryService, @ITextFileService textFileService:ITextFileService,
|
||||
@ILifecycleService lifecycleService: ILifecycleService, @IEventService eventService: IEventService,
|
||||
@IModelService modelService: IModelService, @IExtensionService extensionService: IExtensionService,
|
||||
@IQuickOpenService quickOpenService: IQuickOpenService) {
|
||||
@IQuickOpenService quickOpenService: IQuickOpenService,
|
||||
@IEnvironmentService private environmentService: IEnvironmentService) {
|
||||
|
||||
super();
|
||||
this.modeService = modeService;
|
||||
|
@ -637,7 +641,7 @@ class TaskService extends EventEmitter implements ITaskService {
|
|||
this._taskSystem = new NullTaskSystem();
|
||||
this._taskSystemPromise = TPromise.as(this._taskSystem);
|
||||
} else {
|
||||
let variables = new ConfigVariables(this.configurationService, this.editorService, this.contextService);
|
||||
let variables = new ConfigVariables(this.configurationService, this.editorService, this.contextService, this.environmentService);
|
||||
let clearOutput = true;
|
||||
this._taskSystemPromise = TPromise.as(this.configurationService.getConfiguration<TaskConfiguration>('tasks')).then((config: TaskConfiguration) => {
|
||||
let parseErrors: string[] = config ? (<any>config).$parseErrors : null;
|
||||
|
@ -745,7 +749,7 @@ class TaskService extends EventEmitter implements ITaskService {
|
|||
public configureAction(): Action {
|
||||
return new ConfigureTaskRunnerAction(ConfigureTaskRunnerAction.ID, ConfigureTaskRunnerAction.TEXT,
|
||||
this.configurationService, this.editorService, this.fileService, this.contextService,
|
||||
this.outputService, this.messageService, this.quickOpenService);
|
||||
this.outputService, this.messageService, this.quickOpenService, this.environmentService);
|
||||
}
|
||||
|
||||
public build(): TPromise<ITaskSummary> {
|
||||
|
|
|
@ -14,7 +14,7 @@ import { LineProcess } from 'vs/base/node/processes';
|
|||
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
|
||||
import { SystemVariables } from 'vs/workbench/parts/lib/electron-browser/systemVariables';
|
||||
import { SystemVariables } from 'vs/workbench/parts/lib/node/systemVariables';
|
||||
import { IWorkspaceContextService } from 'vs/workbench/services/workspace/common/contextService';
|
||||
|
||||
import * as FileConfig from './processRunnerConfiguration';
|
|
@ -11,7 +11,7 @@ import * as Platform from 'vs/base/common/platform';
|
|||
import { ProblemMatcher, FileLocationKind, ProblemPattern, ApplyToKind } from 'vs/platform/markers/common/problemMatcher';
|
||||
|
||||
import * as TaskSystem from 'vs/workbench/parts/tasks/common/taskSystem';
|
||||
import { parse, ParseResult, ILogger, ExternalTaskRunnerConfiguration } from 'vs/workbench/parts/tasks/electron-browser/processRunnerConfiguration';
|
||||
import { parse, ParseResult, ILogger, ExternalTaskRunnerConfiguration } from 'vs/workbench/parts/tasks/node/processRunnerConfiguration';
|
||||
|
||||
class Logger implements ILogger {
|
||||
public receivedMessage: boolean = false;
|
Loading…
Reference in a new issue