src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.ts/BracketPairsTextModelPart/matchBracket
class BracketPairsTextModelPart:	public matchBracket(position: IPosition, maxDuration?: number): [Range, Range] | null {
		if (this.canBuildAST) {
			const bracketPair = findLastMaxBy(
				this.getBracketPairsInRange(
					Range.fromPositions(position, position)
				).filter(
					(item) =>
						item.closingBracketRange !== undefined &&
						(item.openingBracketRange.containsPosition(position) ||
							item.closingBracketRange.containsPosition(position))
				),
				compareBy(
					(item) =>
						item.openingBracketRange.containsPosition(position)
							? item.openingBracketRange
							: item.closingBracketRange,
					Range.compareRangesUsingStarts
				)
			);
			if (bracketPair) {
				return [bracketPair.openingBracketRange, bracketPair.closingBracketRange!];
			}
			return null;
		} else {
			// Fallback to old bracket matching code:
			const continueSearchPredicate = createTimeBasedContinueBracketSearchPredicate(maxDuration);
			return this._matchBracket(this.textModel.validatePosition(position), continueSearchPredicate);
		}
	}