src/vs/editor/common/model/guidesTextModelPart.ts/GuidesTextModelPart/getLinesBracketGuides
class GuidesTextModelPart:	public getLinesBracketGuides(
		startLineNumber: number,
		endLineNumber: number,
		activePosition: IPosition | null,
		options: BracketGuideOptions
	): IndentGuide[][] {
		const result: IndentGuide[][] = [];
		for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
			result.push([]);
		}

		// If requested, this could be made configurable.
		const includeSingleLinePairs = true;

		const bracketPairs =
			this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(
				new Range(
					startLineNumber,
					1,
					endLineNumber,
					this.textModel.getLineMaxColumn(endLineNumber)
				)
			).toArray();

		let activeBracketPairRange: Range | undefined = undefined;
		if (activePosition && bracketPairs.length > 0) {
			const bracketsContainingActivePosition = (
				startLineNumber <= activePosition.lineNumber &&
					activePosition.lineNumber <= endLineNumber
					// We don't need to query the brackets again if the cursor is in the viewport
					? bracketPairs
					: this.textModel.bracketPairs.getBracketPairsInRange(
						Range.fromPositions(activePosition)
					).toArray()
			).filter((bp) => Range.strictContainsPosition(bp.range, activePosition));

			activeBracketPairRange = findLast(
				bracketsContainingActivePosition,
				(i) => includeSingleLinePairs || i.range.startLineNumber !== i.range.endLineNumber
			)?.range;
		}

		const independentColorPoolPerBracketType = this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType;
		const colorProvider = new BracketPairGuidesClassNames();

		for (const pair of bracketPairs) {
			/*


					{
					|
					}

					{
					|
					----}

				____{
				|test
				----}

				renderHorizontalEndLineAtTheBottom:
					{
					|
					|x}
					--
				renderHorizontalEndLineAtTheBottom:
				____{
				|test
				| x }
				----
			*/

			if (!pair.closingBracketRange) {
				continue;
			}

			const isActive = activeBracketPairRange && pair.range.equalsRange(activeBracketPairRange);

			if (!isActive && !options.includeInactive) {
				continue;
			}

			const className =
				colorProvider.getInlineClassName(pair.nestingLevel, pair.nestingLevelOfEqualBracketType, independentColorPoolPerBracketType) +
				(options.highlightActive && isActive
					? ' ' + colorProvider.activeClassName
					: '');


			const start = pair.openingBracketRange.getStartPosition();
			const end = pair.closingBracketRange.getStartPosition();

			const horizontalGuides = options.horizontalGuides === HorizontalGuidesState.Enabled || (options.horizontalGuides === HorizontalGuidesState.EnabledForActive && isActive);

			if (pair.range.startLineNumber === pair.range.endLineNumber) {
				if (includeSingleLinePairs && horizontalGuides) {

					result[pair.range.startLineNumber - startLineNumber].push(
						new IndentGuide(
							-1,
							pair.openingBracketRange.getEndPosition().column,
							className,
							new IndentGuideHorizontalLine(false, end.column),
							-1,
							-1,
						)
					);

				}
				continue;
			}

			const endVisibleColumn = this.getVisibleColumnFromPosition(end);
			const startVisibleColumn = this.getVisibleColumnFromPosition(
				pair.openingBracketRange.getStartPosition()
			);
			const guideVisibleColumn = Math.min(startVisibleColumn, endVisibleColumn, pair.minVisibleColumnIndentation + 1);

			let renderHorizontalEndLineAtTheBottom = false;


			const firstNonWsIndex = strings.firstNonWhitespaceIndex(
				this.textModel.getLineContent(
					pair.closingBracketRange.startLineNumber
				)
			);
			const hasTextBeforeClosingBracket = firstNonWsIndex < pair.closingBracketRange.startColumn - 1;
			if (hasTextBeforeClosingBracket) {
				renderHorizontalEndLineAtTheBottom = true;
			}


			const visibleGuideStartLineNumber = Math.max(start.lineNumber, startLineNumber);
			const visibleGuideEndLineNumber = Math.min(end.lineNumber, endLineNumber);

			const offset = renderHorizontalEndLineAtTheBottom ? 1 : 0;

			for (let l = visibleGuideStartLineNumber; l < visibleGuideEndLineNumber + offset; l++) {
				result[l - startLineNumber].push(
					new IndentGuide(
						guideVisibleColumn,
						-1,
						className,
						null,
						l === start.lineNumber ? start.column : -1,
						l === end.lineNumber ? end.column : -1
					)
				);
			}

			if (horizontalGuides) {
				if (start.lineNumber >= startLineNumber && startVisibleColumn > guideVisibleColumn) {
					result[start.lineNumber - startLineNumber].push(
						new IndentGuide(
							guideVisibleColumn,
							-1,
							className,
							new IndentGuideHorizontalLine(false, start.column),
							-1,
							-1,
						)
					);
				}

				if (end.lineNumber <= endLineNumber && endVisibleColumn > guideVisibleColumn) {
					result[end.lineNumber - startLineNumber].push(
						new IndentGuide(
							guideVisibleColumn,
							-1,
							className,
							new IndentGuideHorizontalLine(!renderHorizontalEndLineAtTheBottom, end.column),
							-1,
							-1,
						)
					);
				}
			}
		}

		for (const guides of result) {
			guides.sort((a, b) => a.visibleColumn - b.visibleColumn);
		}

		return result;
	}