Resolve customExecution task definition before going to exthost

Part of #81007
This commit is contained in:
Alex Ross
2020-08-14 16:28:14 +02:00
parent 1d3bea8480
commit 8418e06a5b
5 changed files with 12 additions and 37 deletions

View File

@@ -414,10 +414,16 @@ export class MainThreadTask implements MainThreadTaskShape {
) {
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostTask);
this._providers = new Map();
this._taskService.onDidStateChange((event: TaskEvent) => {
this._taskService.onDidStateChange(async (event: TaskEvent) => {
const task = event.__task!;
if (event.kind === TaskEventKind.Start) {
this._proxy.$onDidStartTask(TaskExecutionDTO.from(task.getTaskExecution()), event.terminalId!);
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');
}
this._proxy.$onDidStartTask(execution, event.terminalId!, resolvedDefinition);
} else if (event.kind === TaskEventKind.ProcessStarted) {
this._proxy.$onDidStartTaskProcess(TaskProcessStartedDTO.from(task.getTaskExecution(), event.processId!));
} else if (event.kind === TaskEventKind.ProcessEnded) {