diff --git a/src/vs/workbench/api/node/extHostDebugService.ts b/src/vs/workbench/api/node/extHostDebugService.ts index 2ae91c279e14e6d7f449b0248ed252daac3a6444..b969522ba5e830d95d538e5495043ec6a03602f8 100644 --- a/src/vs/workbench/api/node/extHostDebugService.ts +++ b/src/vs/workbench/api/node/extHostDebugService.ts @@ -547,8 +547,8 @@ export class ExtHostVariableResolverService implements IConfigurationResolverSer getConfigurationValue: (folderUri: URI, section: string) => { return configuration.getConfiguration(undefined, folderUri).get(section); }, - getEnvironmentService: (name: string): string => { - return undefined; + getExecPath: (): string | undefined => { + return undefined; // does not exist in EH }, getFilePath: (): string | undefined => { const activeEditor = editors.activeEditor(); @@ -561,7 +561,6 @@ export class ExtHostVariableResolverService implements IConfigurationResolverSer return undefined; }, getSelectedText: (): string | undefined => { - debugger; const activeEditor = editors.activeEditor(); if (activeEditor && !activeEditor.selection.isEmpty) { return activeEditor.document.getText(activeEditor.selection); diff --git a/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts index 26c6ee9cf955d305a3d29fe6059b5276bf056580..080f600ce818316d3a31d5a26cb4302fbce38179 100644 --- a/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts @@ -45,8 +45,8 @@ export class ConfigurationResolverService implements IConfigurationResolverServi getConfigurationValue: (folderUri: uri, suffix: string) => { return configurationService.getValue(suffix, folderUri ? { resource: folderUri } : undefined); }, - getEnvironmentService: (name: string) => { - return environmentService[name]; + getExecPath: () => { + return environmentService['execPath']; }, getFilePath: (): string | undefined => { let input = editorService.getActiveEditorInput(); diff --git a/src/vs/workbench/services/configurationResolver/node/variableResolver.ts b/src/vs/workbench/services/configurationResolver/node/variableResolver.ts index 76c5a42311355610ae189a82cb2ab60e931b25cd..a8fc1e8b982a63afa6f3bc60e73201a94cfd96f7 100644 --- a/src/vs/workbench/services/configurationResolver/node/variableResolver.ts +++ b/src/vs/workbench/services/configurationResolver/node/variableResolver.ts @@ -17,7 +17,7 @@ export interface IVariableAccessor { getFolderUri(folderName: string): uri | undefined; getWorkspaceFolderCount(): number; getConfigurationValue(folderUri: uri, section: string): string | undefined; - getEnvironmentService(name: string): string | undefined; + getExecPath(): string | undefined; getFilePath(): string | undefined; getSelectedText(): string | undefined; getLineNumber(): string; @@ -193,7 +193,11 @@ export class VariableResolver { return basename.slice(0, basename.length - paths.extname(basename).length); case 'execPath': - return this.accessor.getEnvironmentService('execPath'); + const ep = this.accessor.getExecPath(); + if (ep) { + return ep; + } + throw new Error(localize('canNotResolveExecPath', "'{0}' can not be resolved.", match)); default: return match;