Skip to content

Commit 1bbc930

Browse files
committed
Glob doesn't work when only 1 glob match
1 parent 078ed94 commit 1bbc930

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,6 +2861,21 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
28612861
});
28622862
};
28632863

2864+
const resolveTaskAndRun = (taskGroupTask: Task | ConfiguringTask) => {
2865+
if (ConfiguringTask.is(taskGroupTask)) {
2866+
this.tryResolveTask(taskGroupTask).then(resolvedTask => {
2867+
runSingleTask(resolvedTask, undefined, this);
2868+
});
2869+
} else {
2870+
runSingleTask(taskGroupTask, undefined, this);
2871+
}
2872+
};
2873+
2874+
// A single default glob task was returned, just run it directly
2875+
if (taskGroupTasks.length === 1) {
2876+
return resolveTaskAndRun(taskGroupTasks[0]);
2877+
}
2878+
28642879
// If there's multiple globs that match we want to show the quick picker for those tasks
28652880
// We will need to call splitPerGroupType putting globs in defaults and the remaining tasks in none.
28662881
// We don't need to carry on after here
@@ -2873,19 +2888,9 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
28732888
taskGroupTasks = await this._findWorkspaceTasksInGroup(taskGroup, false);
28742889
}
28752890

2876-
28772891
// A single default task was returned, just run it directly
28782892
if (taskGroupTasks.length === 1) {
2879-
const taskGroupTask = taskGroupTasks[0];
2880-
if (ConfiguringTask.is(taskGroupTask)) {
2881-
this.tryResolveTask(taskGroupTask).then(resolvedTask => {
2882-
runSingleTask(resolvedTask, undefined, this);
2883-
});
2884-
} else {
2885-
runSingleTask(taskGroupTask, undefined, this);
2886-
}
2887-
2888-
return;
2893+
return resolveTaskAndRun(taskGroupTasks[0]);
28892894
}
28902895

28912896
// Multiple default tasks returned, show the quickPicker

0 commit comments

Comments
 (0)