mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 12:06:27 +00:00
fix #184454
This commit is contained in:
parent
e8e027ad44
commit
b3bbaec18a
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue