Do not invoke resolveWithInteraction over terminal settings (#123590)

This commit is contained in:
Alex Dima 2021-05-11 19:10:55 +02:00
parent 5f3466a21e
commit 7259955ce3
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
3 changed files with 10 additions and 3 deletions

View file

@ -142,10 +142,10 @@ export class RemoteTerminalChannelClient {
const lastActiveWorkspace = activeWorkspaceRootUri ? withNullAsUndefined(this._workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri)) : undefined;
let allResolvedVariables: Map<string, string> | undefined = undefined;
try {
allResolvedVariables = await this._resolverService.resolveWithInteraction(lastActiveWorkspace, {
allResolvedVariables = (await this._resolverService.resolveAnyMap(lastActiveWorkspace, {
shellLaunchConfig,
configuration
});
})).resolvedVariables;
} catch (err) {
this._logService.error(err);
}

View file

@ -26,6 +26,13 @@ export interface IConfigurationResolverService {
*/
resolveAnyAsync(folder: IWorkspaceFolder | undefined, config: any, commandValueMapping?: IStringDictionary<string>): Promise<any>;
/**
* Recursively resolves all variables in the given config.
* Returns a copy of it with substituted values and a map of variables and their resolution.
* Keys in the map will be of the format input:variableName or command:variableName.
*/
resolveAnyMap(folder: IWorkspaceFolder | undefined, config: any, commandValueMapping?: IStringDictionary<string>): Promise<{ newConfig: any, resolvedVariables: Map<string, string> }>;
/**
* Recursively resolves all variables (including commands and user input) in the given config and returns a copy of it with substituted values.
* If a "variables" dictionary (with names -> command ids) is given, command variables are first mapped through it before being resolved.

View file

@ -99,7 +99,7 @@ export class AbstractVariableResolverService implements IConfigurationResolverSe
return this.resolveAnyBase(workspaceFolder, config, commandValueMapping);
}
protected async resolveAnyMap(workspaceFolder: IWorkspaceFolder | undefined, config: any, commandValueMapping?: IStringDictionary<string>): Promise<{ newConfig: any, resolvedVariables: Map<string, string> }> {
public async resolveAnyMap(workspaceFolder: IWorkspaceFolder | undefined, config: any, commandValueMapping?: IStringDictionary<string>): Promise<{ newConfig: any, resolvedVariables: Map<string, string> }> {
const resolvedVariables = new Map<string, string>();
const newConfig = await this.resolveAnyBase(workspaceFolder, config, commandValueMapping, resolvedVariables);
return { newConfig, resolvedVariables };