src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts/AbstractTaskService/_runTaskCommand
class AbstractTaskService:	private _runTaskCommand(arg?: any): void {
		const identifier = this._getTaskIdentifier(arg);
		const type = arg && typeof arg !== 'string' && 'type' in arg ? arg.type : undefined;
		const task = arg && typeof arg !== 'string' && 'task' in arg ? arg.task : arg === 'string' ? arg : undefined;
		if (!identifier && !task && !type) {
			return this._doRunTaskCommand();
		}
		this._getGroupedTasks().then(async (grouped) => {
			const tasks = grouped.all();
			const resolver = this._createResolver(grouped);
			const folderURIs: (URI | string)[] = this._contextService.getWorkspace().folders.map(folder => folder.uri);
			if (this._contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) {
				folderURIs.push(this._contextService.getWorkspace().configuration!);
			}
			folderURIs.push(USER_TASKS_GROUP_KEY);
			if (identifier) {
				for (const uri of folderURIs) {
					const task = await resolver.resolve(uri, identifier);
					if (task) {
						this.run(task).then(undefined, () => { });
						return;
					}
				}
			}
			const exactMatchTask = tasks.find(t => task && (t.getDefinition(true)?.configurationProperties?.identifier === task || t.configurationProperties?.identifier === task || t._label === task));
			if (exactMatchTask) {
				const id = exactMatchTask.configurationProperties?.identifier || exactMatchTask.getDefinition(true)?.configurationProperties?.identifier;
				if (id) {
					for (const uri of folderURIs) {
						const task = await resolver.resolve(uri, id);
						if (task) {
							this.run(task, { attachProblemMatcher: true }, TaskRunSource.User).then(undefined, () => { });
							return;
						}
					}
				}
			}
			const atLeastOneMatch = tasks.some(t => {
				if (task) {
					if (t._label.includes(task)) {
						if (!type || t.type === type) {
							return true;
						}
					}
				} else if (type && t.type === type) {
					return true;
				}
				return false;
			});
			return atLeastOneMatch ? this._doRunTaskCommand(tasks, type, task) : this._doRunTaskCommand();
		});
	}