This commit is contained in:
meganrogge 2024-04-03 12:16:28 -07:00
parent e8e027ad44
commit b3bbaec18a
No known key found for this signature in database
GPG key ID: AA74638D4878183D

View file

@ -2948,7 +2948,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
*/
private _getDefaultTasks(tasks: Task[], taskGlobsInList: boolean = false): Task[] {
const defaults: Task[] = [];
for (const task of tasks) {
for (const task of tasks.filter(t => !!t.configurationProperties.group)) {
// At this point (assuming taskGlobsInList is true) there are tasks with matching globs, so only put those in defaults
if (taskGlobsInList && typeof (task.configurationProperties.group as TaskGroup).isDefault === 'string') {
defaults.push(task);
@ -3050,16 +3050,22 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
// If no globs are found or matched fallback to checking for default tasks of the task group
if (!groupTasks.length) {
groupTasks = await this._findWorkspaceTasksInGroup(taskGroup, false);
groupTasks = await this._findWorkspaceTasksInGroup(taskGroup, true);
}
// A single default task was returned, just run it directly
if (groupTasks.length === 1) {
return resolveTaskAndRun(groupTasks[0]);
}
switch (groupTasks.length) {
case 0:
// No tasks found, prompt to configure
configure.apply(this);
break;
case 1:
// A single default task was returned, just run it directly
return resolveTaskAndRun(groupTasks[0]);
// Multiple default tasks returned, show the quickPicker
return handleMultipleTasks(false);
default:
// Multiple default tasks returned, show the quickPicker
return handleMultipleTasks(false);
}
})();
this._progressService.withProgress(options, () => promise);
}