Change:
VSCode Version:1.4 OS Version:OS X Steps to Reproduce: a simple python file with the following code a virtual environment under "p27" subdirectory of the workspace root. the path to python interpreter as follows the path to the pythonPath in is configured as follows the file created in step 2. Error displayed: Problem: The token ${workspaceRoot} has not been resolved to the workspace root path. The bug is in . The value returned contains the tokens ${workspaceRoot} that needs to be resolved.

Discussion:
} protected resolveString(value: string): string { <ins> const originalValue = value; </ins> value = super.resolveString(value); let regexp = /${config.(.*?)}/g;

let config = this.configurationService.getConfiguration(); let newValue = new Function('_', 'try {return _.' + name + ';} catch (ex) { return "";}')(config); if (Types.isString(newValue)) { <del> return newValue; } else { </del> <ins> // Prevent infinite recursion and also support nested references (or tokens) return newValue === originalValue ? '' : this.resolveString(newValue); } else { </ins> return this.resolve(newValue) + ''; } });

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'); }); <ins> test('ConfigVariables: substitute nested configs', () => { let configurationService: IConfigurationService; configurationService = new MockConfigurationService({ editor: { fontFamily: 'foo ${workspaceRoot} ${config.terminal.integrated.fontFamily}' }, terminal: { integrated: { fontFamily: 'bar' } } }); let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation')); if (Platform.isWindows) { assert.strictEqual(systemVariables.resolve('abc ${config.editor.fontFamily} ${config.terminal.integrated.fontFamily} xyz'), 'abc foo VSCodeworkspaceLocation bar bar xyz'); } else { assert.strictEqual(systemVariables.resolve('abc ${config.editor.fontFamily} ${config.terminal.integrated.fontFamily} xyz'), 'abc foo /VSCode/workspaceLocation bar bar xyz'); } }); test('ConfigVariables: substitute accidental self referenced configs', () => { let configurationService: IConfigurationService; configurationService = new MockConfigurationService({ editor: { fontFamily: 'foo ${workspaceRoot} ${config.terminal.integrated.fontFamily} ${config.editor.fontFamily}' }, terminal: { integrated: { fontFamily: 'bar' } } }); let systemVariables: ConfigVariables = new ConfigVariables(configurationService, null, null, TestEnvironmentService, URI.parse('file:///VSCode/workspaceLocation')); if (Platform.isWindows) { assert.strictEqual(systemVariables.resolve('abc ${config.editor.fontFamily} ${config.terminal.integrated.fontFamily} xyz'), 'abc foo VSCodeworkspaceLocation bar  bar xyz'); } else { assert.strictEqual(systemVariables.resolve('abc ${config.editor.fontFamily} ${config.terminal.integrated.fontFamily} xyz'), 'abc foo /VSCode/workspaceLocation bar  bar xyz'); } }); </ins> test('SystemVariables: substitute one env variable', () => { let configurationService: IConfigurationService; configurationService = new MockConfigurationService({