src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts/AbstractTaskService/_openEditorAtTask
class AbstractTaskService:	private _openEditorAtTask(resource: URI | undefined, task: TaskConfig.ICustomTask | TaskConfig.IConfiguringTask | string | undefined, configIndex: number = -1): Promise<boolean> {
		if (resource === undefined) {
			return Promise.resolve(false);
		}
		let selection: ITextEditorSelection | undefined;
		return this._fileService.readFile(resource).then(content => content.value).then(async content => {
			if (!content) {
				return false;
			}
			if (task) {
				const contentValue = content.toString();
				let stringValue: string | undefined;
				if (configIndex !== -1) {
					const json: TaskConfig.IExternalTaskRunnerConfiguration = this._configurationService.getValue<TaskConfig.IExternalTaskRunnerConfiguration>('tasks', { resource });
					if (json.tasks && (json.tasks.length > configIndex)) {
						stringValue = await this._formatTaskForJson(resource, json.tasks[configIndex]);
					}
				}
				if (!stringValue) {
					if (typeof task === 'string') {
						stringValue = task;
					} else {
						stringValue = await this._formatTaskForJson(resource, task);
					}
				}

				const index = contentValue.indexOf(stringValue);
				let startLineNumber = 1;
				for (let i = 0; i < index; i++) {
					if (contentValue.charAt(i) === '\n') {
						startLineNumber++;
					}
				}
				let endLineNumber = startLineNumber;
				for (let i = 0; i < stringValue.length; i++) {
					if (stringValue.charAt(i) === '\n') {
						endLineNumber++;
					}
				}
				selection = startLineNumber > 1 ? { startLineNumber, startColumn: startLineNumber === endLineNumber ? 4 : 3, endLineNumber, endColumn: startLineNumber === endLineNumber ? undefined : 4 } : undefined;
			}

			return this._editorService.openEditor({
				resource,
				options: {
					pinned: false,
					forceReload: true, // because content might have changed
					selection,
					selectionRevealType: TextEditorSelectionRevealType.CenterIfOutsideViewport
				}
			}).then(() => !!selection);
		});
	}