src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts/AbstractTaskService/tasks
class AbstractTaskService:	public async tasks(filter?: TaskFilter): Promise<Task[]> {
		if (!(await this.trust())) {
			return [];
		}
		if (!this.versionAndEngineCompatible(filter)) {
			return Promise.resolve<Task[]>([]);
		}
		return this.getGroupedTasks(filter ? filter.type : undefined).then((map) => {
			if (!filter || !filter.type) {
				return map.all();
			}
			let result: Task[] = [];
			map.forEach((tasks) => {
				for (let task of tasks) {
					if (ContributedTask.is(task) && ((task.defines.type === filter.type) || (task._source.label === filter.type))) {
						result.push(task);
					} else if (CustomTask.is(task)) {
						if (task.type === filter.type) {
							result.push(task);
						} else {
							let customizes = task.customizes();
							if (customizes && customizes.type === filter.type) {
								result.push(task);
							}
						}
					}
				}
			});
			return result;
		});
	}