src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts/AbstractTaskService/_runTaskGroupCommand
class AbstractTaskService:	private _runTaskGroupCommand(taskGroup: TaskGroup, strings: {
		fetching: string;
		select: string;
		notFoundConfigure: string;
	}, configure: () => void, legacyCommand: () => void): void {
		if (!this._canRunCommand()) {
			return;
		}
		if (this.schemaVersion === JsonSchemaVersion.V0_1_0) {
			legacyCommand();
			return;
		}
		const options: IProgressOptions = {
			location: ProgressLocation.Window,
			title: strings.fetching
		};
		const promise = (async () => {

			let taskGroupTasks: (Task | ConfiguringTask)[] = [];

			async function runSingleTask(task: Task | undefined, problemMatcherOptions: IProblemMatcherRunOptions | undefined, that: AbstractTaskService) {
				that.run(task, problemMatcherOptions, TaskRunSource.User).then(undefined, reason => {
					// eat the error, it has already been surfaced to the user and we don't care about it here
				});
			}

			const chooseAndRunTask = (tasks: Task[]) => {
				this._showIgnoredFoldersMessage().then(() => {
					this._showQuickPick(tasks,
						strings.select,
						{
							label: strings.notFoundConfigure,
							task: null
						},
						true).then((entry) => {
							const task: Task | undefined | null = entry ? entry.task : undefined;
							if (task === undefined) {
								return;
							}
							if (task === null) {
								configure();
								return;
							}
							runSingleTask(task, { attachProblemMatcher: true }, this);
						});
				});
			};

			// First check for globs before checking for the default tasks of the task group
			const absoluteURI = EditorResourceAccessor.getOriginalUri(this._editorService.activeEditor);
			if (absoluteURI) {
				const workspaceFolder = this._contextService.getWorkspaceFolder(absoluteURI);
				// fallback to absolute path of the file if it is not in a workspace or relative path cannot be found
				const relativePath = workspaceFolder?.uri ? (resources.relativePath(workspaceFolder.uri, absoluteURI) ?? absoluteURI.path) : absoluteURI.path;

				taskGroupTasks = await this._findWorkspaceTasks((task) => {
					const taskGroup = task.configurationProperties.group;
					if (taskGroup && typeof taskGroup !== 'string' && typeof taskGroup.isDefault === 'string') {
						return (taskGroup._id === taskGroup._id && glob.match(taskGroup.isDefault, relativePath));
					}

					return false;
				});
			}

			const handleMultipleTasks = (areGlobTasks: boolean) => {
				return this._getTasksForGroup(taskGroup).then((tasks) => {
					if (tasks.length > 0) {
						// If we're dealing with tasks that were chosen because of a glob match,
						// then put globs in the defaults and everything else in none
						const { none, defaults } = this._splitPerGroupType(tasks, areGlobTasks);
						if (defaults.length === 1) {
							runSingleTask(defaults[0], undefined, this);
							return;
						} else if (defaults.length + none.length > 0) {
							tasks = defaults.concat(none);
						}
					}

					// At this this point there are multiple tasks.
					chooseAndRunTask(tasks);
				});
			};

			const resolveTaskAndRun = (taskGroupTask: Task | ConfiguringTask) => {
				if (ConfiguringTask.is(taskGroupTask)) {
					this.tryResolveTask(taskGroupTask).then(resolvedTask => {
						runSingleTask(resolvedTask, undefined, this);
					});
				} else {
					runSingleTask(taskGroupTask, undefined, this);
				}
			};

			// A single default glob task was returned, just run it directly
			if (taskGroupTasks.length === 1) {
				return resolveTaskAndRun(taskGroupTasks[0]);
			}

			// If there's multiple globs that match we want to show the quick picker for those tasks
			// We will need to call splitPerGroupType putting globs in defaults and the remaining tasks in none.
			// We don't need to carry on after here
			if (taskGroupTasks.length > 1) {
				return handleMultipleTasks(true);
			}

			// If no globs are found or matched fallback to checking for default tasks of the task group
			if (!taskGroupTasks.length) {
				taskGroupTasks = await this._findWorkspaceTasksInGroup(taskGroup, false);
			}

			// A single default task was returned, just run it directly
			if (taskGroupTasks.length === 1) {
				return resolveTaskAndRun(taskGroupTasks[0]);
			}

			// Multiple default tasks returned, show the quickPicker
			return handleMultipleTasks(false);
		})();
		this._progressService.withProgress(options, () => promise);
	}