mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Ensure tasks are resolved when run from extension host
Related to #101884
This commit is contained in:
@@ -54,12 +54,13 @@ export class ExtHostTask extends ExtHostTaskBase {
|
||||
// We have a preserved ID. So the task didn't change.
|
||||
if (tTask._id !== undefined) {
|
||||
// Always get the task execution first to prevent timing issues when retrieving it later
|
||||
const executionDTO = await this._proxy.$getTaskExecution(TaskHandleDTO.from(tTask));
|
||||
const handleDto = TaskHandleDTO.from(tTask);
|
||||
const executionDTO = await this._proxy.$getTaskExecution(handleDto);
|
||||
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(() => { /* The error here isn't actionable. */ });
|
||||
this._proxy.$executeTask(handleDto).catch(() => { /* The error here isn't actionable. */ });
|
||||
return execution;
|
||||
} else {
|
||||
const dto = TaskDTO.from(task, extension);
|
||||
|
||||
Reference in New Issue
Block a user