From dffbeac1f63200dfce8fb4d8559c3f1dff5cfd0b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 17 Aug 2016 12:46:29 +0200 Subject: [PATCH] use execPath from remote (node => electron-browser) --- .../debugConfigurationManager.ts | 2 +- .../parts/debug/electron-browser/debugService.ts | 2 +- .../lib/{node => electron-browser}/configVariables.ts | 0 .../lib/{node => electron-browser}/systemVariables.ts | 11 +++++++++-- .../configVariables.test.ts | 2 +- .../systemVariables.test.ts | 2 +- .../processRunnerConfiguration.ts | 0 .../processRunnerDetector.ts | 2 +- .../{node => electron-browser}/processRunnerSystem.ts | 0 .../parts/tasks/electron-browser/task.contribution.ts | 8 ++++---- .../{node => electron-browser}/configuration.test.ts | 2 +- 11 files changed, 19 insertions(+), 12 deletions(-) rename src/vs/workbench/parts/debug/{node => electron-browser}/debugConfigurationManager.ts (99%) rename src/vs/workbench/parts/lib/{node => electron-browser}/configVariables.ts (100%) rename src/vs/workbench/parts/lib/{node => electron-browser}/systemVariables.ts (89%) rename src/vs/workbench/parts/lib/test/{node => electron-browser}/configVariables.test.ts (98%) rename src/vs/workbench/parts/lib/test/{node => electron-browser}/systemVariables.test.ts (96%) rename src/vs/workbench/parts/tasks/{node => electron-browser}/processRunnerConfiguration.ts (100%) rename src/vs/workbench/parts/tasks/{node => electron-browser}/processRunnerDetector.ts (99%) rename src/vs/workbench/parts/tasks/{node => electron-browser}/processRunnerSystem.ts (100%) rename src/vs/workbench/parts/tasks/test/{node => electron-browser}/configuration.test.ts (99%) diff --git a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts similarity index 99% rename from src/vs/workbench/parts/debug/node/debugConfigurationManager.ts rename to src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts index 7190ecb713a..82e7a45da48 100644 --- a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts @@ -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 diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 6e1dd81fc0e..8901ca8ba55 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -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'; diff --git a/src/vs/workbench/parts/lib/node/configVariables.ts b/src/vs/workbench/parts/lib/electron-browser/configVariables.ts similarity index 100% rename from src/vs/workbench/parts/lib/node/configVariables.ts rename to src/vs/workbench/parts/lib/electron-browser/configVariables.ts diff --git a/src/vs/workbench/parts/lib/node/systemVariables.ts b/src/vs/workbench/parts/lib/electron-browser/systemVariables.ts similarity index 89% rename from src/vs/workbench/parts/lib/node/systemVariables.ts rename to src/vs/workbench/parts/lib/electron-browser/systemVariables.ts index cf0c926eae2..6b1ceb01e73 100644 --- a/src/vs/workbench/parts/lib/node/systemVariables.ts +++ b/src/vs/workbench/parts/lib/electron-browser/systemVariables.ts @@ -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]; }); diff --git a/src/vs/workbench/parts/lib/test/node/configVariables.test.ts b/src/vs/workbench/parts/lib/test/electron-browser/configVariables.test.ts similarity index 98% rename from src/vs/workbench/parts/lib/test/node/configVariables.test.ts rename to src/vs/workbench/parts/lib/test/electron-browser/configVariables.test.ts index 8db9034d64e..426566d9e6d 100644 --- a/src/vs/workbench/parts/lib/test/node/configVariables.test.ts +++ b/src/vs/workbench/parts/lib/test/electron-browser/configVariables.test.ts @@ -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'; diff --git a/src/vs/workbench/parts/lib/test/node/systemVariables.test.ts b/src/vs/workbench/parts/lib/test/electron-browser/systemVariables.test.ts similarity index 96% rename from src/vs/workbench/parts/lib/test/node/systemVariables.test.ts rename to src/vs/workbench/parts/lib/test/electron-browser/systemVariables.test.ts index 859beef7969..fe02628c5d2 100644 --- a/src/vs/workbench/parts/lib/test/node/systemVariables.test.ts +++ b/src/vs/workbench/parts/lib/test/electron-browser/systemVariables.test.ts @@ -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', () => { diff --git a/src/vs/workbench/parts/tasks/node/processRunnerConfiguration.ts b/src/vs/workbench/parts/tasks/electron-browser/processRunnerConfiguration.ts similarity index 100% rename from src/vs/workbench/parts/tasks/node/processRunnerConfiguration.ts rename to src/vs/workbench/parts/tasks/electron-browser/processRunnerConfiguration.ts diff --git a/src/vs/workbench/parts/tasks/node/processRunnerDetector.ts b/src/vs/workbench/parts/tasks/electron-browser/processRunnerDetector.ts similarity index 99% rename from src/vs/workbench/parts/tasks/node/processRunnerDetector.ts rename to src/vs/workbench/parts/tasks/electron-browser/processRunnerDetector.ts index 65b0bebe92d..92bc732878a 100644 --- a/src/vs/workbench/parts/tasks/node/processRunnerDetector.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/processRunnerDetector.ts @@ -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'; diff --git a/src/vs/workbench/parts/tasks/node/processRunnerSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/processRunnerSystem.ts similarity index 100% rename from src/vs/workbench/parts/tasks/node/processRunnerSystem.ts rename to src/vs/workbench/parts/tasks/electron-browser/processRunnerSystem.ts diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index f2879355a87..37caab456a4 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -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.$; diff --git a/src/vs/workbench/parts/tasks/test/node/configuration.test.ts b/src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts similarity index 99% rename from src/vs/workbench/parts/tasks/test/node/configuration.test.ts rename to src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts index b98a68d7cb6..eabcaa72275 100644 --- a/src/vs/workbench/parts/tasks/test/node/configuration.test.ts +++ b/src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts @@ -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; -- GitLab