Skip to content

Commit

Permalink
Check task uri when quick resolving dependencies (#144836)
Browse files Browse the repository at this point in the history
Fixes #144761
  • Loading branch information
alexr00 committed Mar 10, 2022
1 parent 0af7459 commit c722ca6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
Expand Up @@ -1585,8 +1585,13 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer

let resolverData: Map<string, ResolverData> | undefined;

async function quickResolve(that: AbstractTaskService, identifier: string | TaskIdentifier) {
async function quickResolve(that: AbstractTaskService, uri: URI | string, identifier: string | TaskIdentifier) {
const foundTasks = await that._findWorkspaceTasks((task: Task | ConfiguringTask): boolean => {
const taskUri = ((ConfiguringTask.is(task) || CustomTask.is(task)) ? task._source.config.workspaceFolder?.uri : undefined);
const originalUri = (typeof uri === 'string' ? uri : uri.toString());
if (taskUri?.toString() !== originalUri) {
return false;
}
if (Types.isString(identifier)) {
return ((task._label === identifier) || (task.configurationProperties.identifier === identifier));
} else {
Expand Down Expand Up @@ -1649,7 +1654,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
return undefined;
}
if ((resolverData === undefined) && (grouped === undefined)) {
return (await quickResolve(this, identifier)) ?? fullResolve(this, uri, identifier);
return (await quickResolve(this, uri, identifier)) ?? fullResolve(this, uri, identifier);
} else {
return fullResolve(this, uri, identifier);
}
Expand Down

0 comments on commit c722ca6

Please sign in to comment.