Skip to content

Commit b3bbaec

Browse files
committed
1 parent e8e027a commit b3bbaec

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
29482948
*/
29492949
private _getDefaultTasks(tasks: Task[], taskGlobsInList: boolean = false): Task[] {
29502950
const defaults: Task[] = [];
2951-
for (const task of tasks) {
2951+
for (const task of tasks.filter(t => !!t.configurationProperties.group)) {
29522952
// At this point (assuming taskGlobsInList is true) there are tasks with matching globs, so only put those in defaults
29532953
if (taskGlobsInList && typeof (task.configurationProperties.group as TaskGroup).isDefault === 'string') {
29542954
defaults.push(task);
@@ -3050,16 +3050,22 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
30503050

30513051
// If no globs are found or matched fallback to checking for default tasks of the task group
30523052
if (!groupTasks.length) {
3053-
groupTasks = await this._findWorkspaceTasksInGroup(taskGroup, false);
3053+
groupTasks = await this._findWorkspaceTasksInGroup(taskGroup, true);
30543054
}
30553055

3056-
// A single default task was returned, just run it directly
3057-
if (groupTasks.length === 1) {
3058-
return resolveTaskAndRun(groupTasks[0]);
3059-
}
3056+
switch (groupTasks.length) {
3057+
case 0:
3058+
// No tasks found, prompt to configure
3059+
configure.apply(this);
3060+
break;
3061+
case 1:
3062+
// A single default task was returned, just run it directly
3063+
return resolveTaskAndRun(groupTasks[0]);
30603064

3061-
// Multiple default tasks returned, show the quickPicker
3062-
return handleMultipleTasks(false);
3065+
default:
3066+
// Multiple default tasks returned, show the quickPicker
3067+
return handleMultipleTasks(false);
3068+
}
30633069
})();
30643070
this._progressService.withProgress(options, () => promise);
30653071
}

0 commit comments

Comments
 (0)