use execPath from remote (node => electron-browser)
This commit is contained in:
parent
413a1db68b
commit
dffbeac1f6
11 changed files with 19 additions and 12 deletions
|
@ -29,7 +29,7 @@ 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/node/configVariables';
|
||||
import {ConfigVariables} from 'vs/workbench/parts/lib/electron-browser/configVariables';
|
||||
import {ISystemVariables} from 'vs/base/common/parsers';
|
||||
|
||||
// debuggers extension point
|
|
@ -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/node/debugConfigurationManager';
|
||||
import {ConfigurationManager} from 'vs/workbench/parts/debug/electron-browser/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';
|
||||
|
|
|
@ -13,19 +13,26 @@ 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';
|
||||
|
||||
export class SystemVariables extends AbstractSystemVariables {
|
||||
private _workspaceRoot: string;
|
||||
private _execPath: string;
|
||||
|
||||
// Optional workspaceRoot there to be used in tests.
|
||||
constructor(private editorService: IWorkbenchEditorService, contextService: IWorkspaceContextService, workspaceRoot: URI = null, envVariables: { [key: string]: string } = process.env) {
|
||||
constructor(
|
||||
private editorService: IWorkbenchEditorService,
|
||||
contextService: IWorkspaceContextService,
|
||||
workspaceRoot: URI = null,
|
||||
envVariables: { [key: string]: string } = process.env
|
||||
) {
|
||||
super();
|
||||
let fsPath = '';
|
||||
if (workspaceRoot || (contextService && contextService.getWorkspace())) {
|
||||
fsPath = workspaceRoot ? workspaceRoot.fsPath : contextService.getWorkspace().resource.fsPath;
|
||||
}
|
||||
this._workspaceRoot = Paths.normalize(fsPath, true);
|
||||
this._execPath = contextService ? contextService.getConfiguration().env.execPath : null;
|
||||
this._execPath = remote.process.execPath;
|
||||
Object.keys(envVariables).forEach(key => {
|
||||
this[`env.${key}`] = envVariables[key];
|
||||
});
|
|
@ -7,7 +7,7 @@
|
|||
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/node/configVariables';
|
||||
import { ConfigVariables } from 'vs/workbench/parts/lib/electron-browser/configVariables';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
|
|
@ -8,7 +8,7 @@ import * as assert from 'assert';
|
|||
import URI from 'vs/base/common/uri';
|
||||
import * as Platform from 'vs/base/common/platform';
|
||||
|
||||
import { SystemVariables } from 'vs/workbench/parts/lib/node/systemVariables';
|
||||
import { SystemVariables } from 'vs/workbench/parts/lib/electron-browser/systemVariables';
|
||||
|
||||
suite('SystemVariables tests', () => {
|
||||
test('SystemVariables: substitute one', () => {
|
|
@ -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/node/systemVariables';
|
||||
import { SystemVariables } from 'vs/workbench/parts/lib/electron-browser/systemVariables';
|
||||
import { IWorkspaceContextService } from 'vs/workbench/services/workspace/common/contextService';
|
||||
|
||||
import * as FileConfig from './processRunnerConfiguration';
|
|
@ -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/node/configVariables';
|
||||
import { ConfigVariables } from 'vs/workbench/parts/lib/electron-browser/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,9 @@ 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/node/processRunnerConfiguration';
|
||||
import { ProcessRunnerSystem } from 'vs/workbench/parts/tasks/node/processRunnerSystem';
|
||||
import { ProcessRunnerDetector } from 'vs/workbench/parts/tasks/node/processRunnerDetector';
|
||||
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';
|
||||
|
||||
let $ = Builder.$;
|
||||
|
||||
|
|
|
@ -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/node/processRunnerConfiguration';
|
||||
import { parse, ParseResult, ILogger, ExternalTaskRunnerConfiguration } from 'vs/workbench/parts/tasks/electron-browser/processRunnerConfiguration';
|
||||
|
||||
class Logger implements ILogger {
|
||||
public receivedMessage: boolean = false;
|
Loading…
Reference in a new issue