Add limited support for variables that resolve to other variables

Fixes microsoft/vscode-remote-release#5007
This commit is contained in:
Alex Ross 2021-05-31 14:17:29 +02:00
parent 594fc814bc
commit 0fde806bf8
No known key found for this signature in database
GPG key ID: 89DDDBA66CBA7840

View file

@ -141,7 +141,7 @@ export class AbstractVariableResolverService implements IConfigurationResolverSe
// loop through all variables occurrences in 'value'
const replaced = value.replace(AbstractVariableResolverService.VARIABLE_REGEXP, (match: string, variable: string) => {
// disallow attempted nesting, see #77289
// disallow attempted nesting, see #77289. This doesn't exclude variables that resolve to other variables.
if (variable.includes(AbstractVariableResolverService.VARIABLE_LHS)) {
return match;
}
@ -152,6 +152,10 @@ export class AbstractVariableResolverService implements IConfigurationResolverSe
resolvedVariables.set(variable, resolvedValue);
}
if (resolvedValue.match(AbstractVariableResolverService.VARIABLE_REGEXP)) {
resolvedValue = this.resolveString(environment, folderUri, resolvedValue, commandValueMapping, resolvedVariables);
}
return resolvedValue;
});