Merge from vscode 4d91d96e5e121b38d33508cdef17868bab255eae

This commit is contained in:
ADS Merger
2020-06-18 04:32:54 +00:00
committed by AzureDataStudio
parent a971aee5bd
commit 5e7071e466
1002 changed files with 24201 additions and 13193 deletions

View File

@@ -53,7 +53,14 @@ export class ExtHostTask extends ExtHostTaskBase {
const tTask = (task as types.Task);
// We have a preserved ID. So the task didn't change.
if (tTask._id !== undefined) {
return this._proxy.$executeTask(TaskHandleDTO.from(tTask)).then(value => this.getTaskExecution(value, task));
// Always get the task execution first to prevent timing issues when retrieving it later
const executionDTO = await this._proxy.$getTaskExecution(TaskHandleDTO.from(tTask));
if (executionDTO.task === undefined) {
throw new Error('Task from execution DTO is undefined');
}
const execution = await this.getTaskExecution(executionDTO, task);
this._proxy.$executeTask(executionDTO.task).catch(error => { throw new Error(error); });
return execution;
} else {
const dto = TaskDTO.from(task, extension);
if (dto === undefined) {
@@ -66,8 +73,10 @@ export class ExtHostTask extends ExtHostTaskBase {
if (CustomExecutionDTO.is(dto.execution)) {
await this.addCustomExecution(dto, task, false);
}
return this._proxy.$executeTask(dto).then(value => this.getTaskExecution(value, task));
// Always get the task execution first to prevent timing issues when retrieving it later
const execution = await this.getTaskExecution(await this._proxy.$getTaskExecution(dto), task);
this._proxy.$executeTask(dto).catch(error => { throw new Error(error); });
return execution;
}
}