Skip to content

Commit e3860b3

Browse files
committed
Fixes microsoft#48831: fetchTasks does not return customized tasks.
1 parent ad9e9c8 commit e3860b3

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/vs/workbench/parts/tasks/common/tasks.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,12 @@ export namespace CustomTask {
456456
};
457457
return result;
458458
}
459+
export function customizes(task: CustomTask): TaskIdentifier {
460+
if (task._source && task._source.customizes) {
461+
return task._source.customizes;
462+
}
463+
return undefined;
464+
}
459465
}
460466

461467
export interface ConfiguringTask extends CommonTask, ConfigurationProperties {

src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,17 @@ class TaskService implements ITaskService {
696696
let result: Task[] = [];
697697
map.forEach((tasks) => {
698698
for (let task of tasks) {
699-
let definition = Task.getTaskDefinition(task);
700-
if (definition && definition.type === filter.type) {
699+
if (ContributedTask.is(task) && task.defines.type === filter.type) {
701700
result.push(task);
701+
} else if (CustomTask.is(task)) {
702+
if (task.type === filter.type) {
703+
result.push(task);
704+
} else {
705+
let customizes = CustomTask.customizes(task);
706+
if (customizes && customizes.type === filter.type) {
707+
result.push(task);
708+
}
709+
}
702710
}
703711
}
704712
});

0 commit comments

Comments
 (0)