mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fix accidently starting all onTaskType extensions when running any task; fixes #175821
This commit is contained in:
parent
b80faf9e12
commit
31ed7f7777
|
@ -725,7 +725,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
|||
});
|
||||
}
|
||||
|
||||
public async getTask(folder: IWorkspace | IWorkspaceFolder | string, identifier: string | ITaskIdentifier, compareId: boolean = false): Promise<Task | undefined> {
|
||||
public async getTask(folder: IWorkspace | IWorkspaceFolder | string, identifier: string | ITaskIdentifier, compareId: boolean = false, type: string | undefined = undefined): Promise<Task | undefined> {
|
||||
if (!(await this._trust())) {
|
||||
return;
|
||||
}
|
||||
|
@ -762,7 +762,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
|||
}
|
||||
|
||||
// We didn't find the task, so we need to ask all resolvers about it
|
||||
const map = await this._getGroupedTasks();
|
||||
const map = await this._getGroupedTasks({ type });
|
||||
let values = map.get(folder);
|
||||
values = values.concat(map.get(USER_TASKS_GROUP_KEY));
|
||||
|
||||
|
@ -1842,11 +1842,12 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
|||
await this._updateWorkspaceTasks();
|
||||
const taskFolder = task.getWorkspaceFolder();
|
||||
const taskIdentifier = task.configurationProperties.identifier;
|
||||
const taskType = CustomTask.is(task) ? task.customizes()?.type : (ContributedTask.is(task) ? task.type : undefined);
|
||||
// Since we save before running tasks, the task may have changed as part of the save.
|
||||
// However, if the TaskRunSource is not User, then we shouldn't try to fetch the task again
|
||||
// since this can cause a new'd task to get overwritten with a provided task.
|
||||
taskToRun = ((taskFolder && taskIdentifier && (runSource === TaskRunSource.User))
|
||||
? await this.getTask(taskFolder, taskIdentifier) : task) ?? task;
|
||||
? await this.getTask(taskFolder, taskIdentifier, false, taskType) : task) ?? task;
|
||||
}
|
||||
await ProblemMatcherRegistry.onReady();
|
||||
const executeResult = runSource === TaskRunSource.Reconnect ? this._getTaskSystem().reconnect(taskToRun, resolver) : this._getTaskSystem().run(taskToRun, resolver);
|
||||
|
|
Loading…
Reference in a new issue