Skip to content

Commit 36b1c29

Browse files
committed
fixed bug, we should always fetch all tasks and filter in-memory
1 parent 7701ac4 commit 36b1c29

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/cmakeProject.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3544,10 +3544,13 @@ export class CMakeProject {
35443544
}
35453545
const ref: { name: string; type?: string } =
35463546
typeof cfg.task === 'string' ? { name: cfg.task } : cfg.task!;
3547-
const all = await vscode.tasks.fetchTasks(ref.type ? { type: ref.type } : undefined);
3547+
// Always fetch all tasks — passing { type: 'shell' } or { type: 'process' }
3548+
// to fetchTasks() returns nothing because those are built-in execution
3549+
// types, not contributed task-provider types.
3550+
const all = await vscode.tasks.fetchTasks();
35483551
const matches = all.filter(t =>
35493552
t.name === ref.name &&
3550-
(!ref.type || t.definition.type === ref.type) &&
3553+
(!ref.type || t.definition.type === ref.type || t.source === ref.type) &&
35513554
(t.scope === vscode.TaskScope.Global ||
35523555
t.scope === vscode.TaskScope.Workspace ||
35533556
t.scope === this.workspaceFolder));

0 commit comments

Comments
 (0)