Move task definition variable resolving to be early

Part of #81007
This commit is contained in:
Alex Ross
2020-08-20 13:33:28 +02:00
parent 88b7db2815
commit 73d583f759
3 changed files with 28 additions and 8 deletions

View File

@@ -419,9 +419,11 @@ export class MainThreadTask implements MainThreadTaskShape {
if (event.kind === TaskEventKind.Start) {
const execution = TaskExecutionDTO.from(task.getTaskExecution());
let resolvedDefinition: TaskDefinitionDTO | undefined;
if (execution.task && execution.task.execution && CustomExecutionDTO.is(execution.task.execution)) {
resolvedDefinition = await this._configurationResolverService.resolveWithInteractionReplace(task.getWorkspaceFolder(),
execution.task.definition, 'tasks');
if (execution.task && execution.task.execution && CustomExecutionDTO.is(execution.task.execution) && event.resolvedVariables) {
const dictionary: IStringDictionary<string> = {};
Array.from(event.resolvedVariables.entries()).forEach(entry => dictionary[entry[0]] = entry[1]);
resolvedDefinition = await this._configurationResolverService.resolveAny(task.getWorkspaceFolder(),
execution.task.definition, dictionary);
}
this._proxy.$onDidStartTask(execution, event.terminalId!, resolvedDefinition);
} else if (event.kind === TaskEventKind.ProcessStarted) {