Fix escape from command variable in remote tasks

Fixes #102931
This commit is contained in:
Alex Ross
2020-07-23 10:30:54 +02:00
parent a473814092
commit 9c4ebe2286
3 changed files with 18 additions and 7 deletions

View File

@@ -634,7 +634,7 @@ export class MainThreadTask implements MainThreadTaskShape {
return URI.parse(`${info.scheme}://${info.authority}${path}`);
},
context: this._extHostContext,
resolveVariables: (workspaceFolder: IWorkspaceFolder, toResolve: ResolveSet, target: ConfigurationTarget): Promise<ResolvedVariables> => {
resolveVariables: (workspaceFolder: IWorkspaceFolder, toResolve: ResolveSet, target: ConfigurationTarget): Promise<ResolvedVariables | undefined> => {
const vars: string[] = [];
toResolve.variables.forEach(item => vars.push(item));
return Promise.resolve(this._proxy.$resolveVariables(workspaceFolder.uri, { process: toResolve.process, variables: vars })).then(values => {
@@ -642,8 +642,12 @@ export class MainThreadTask implements MainThreadTaskShape {
forEach(values.variables, (entry) => {
partiallyResolvedVars.push(entry.value);
});
return new Promise<ResolvedVariables>((resolve, reject) => {
return new Promise<ResolvedVariables | undefined>((resolve, reject) => {
this._configurationResolverService.resolveWithInteraction(workspaceFolder, partiallyResolvedVars, 'tasks', undefined, target).then(resolvedVars => {
if (!resolvedVars) {
resolve(undefined);
}
const result: ResolvedVariables = {
process: undefined,
variables: new Map<string, string>()