Skip to content

Commit f756507

Browse files
authored
Merge pull request microsoft#209477 from microsoft/merogge/default-task
fix build task command issues
2 parents efee188 + 81cfeac commit f756507

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

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

Lines changed: 13 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,21 @@ 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]);
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]);
3064+
default:
3065+
// Multiple default tasks returned, show the quickPicker
3066+
return handleMultipleTasks(false);
30593067
}
3060-
3061-
// Multiple default tasks returned, show the quickPicker
3062-
return handleMultipleTasks(false);
30633068
})();
30643069
this._progressService.withProgress(options, () => promise);
30653070
}

0 commit comments

Comments
 (0)