Path: blob/main/src/vs/editor/common/textModelGuides.ts
3292 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { IPosition } from './core/position.js';67export interface IGuidesTextModelPart {8/**9* @internal10*/11getActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;1213/**14* @internal15*/16getLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[];1718/**19* Requests the indent guides for the given range of lines.20* `result[i]` will contain the indent guides of the `startLineNumber + i`th line.21* @internal22*/23getLinesBracketGuides(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][];24}2526export interface IActiveIndentGuideInfo {27startLineNumber: number;28endLineNumber: number;29indent: number;30}3132export enum HorizontalGuidesState {33Disabled,34EnabledForActive,35Enabled36}3738export interface BracketGuideOptions {39includeInactive: boolean;40horizontalGuides: HorizontalGuidesState;41highlightActive: boolean;42}4344export class IndentGuide {45constructor(46public readonly visibleColumn: number | -1,47public readonly column: number | -1,48public readonly className: string,49/**50* If set, this indent guide is a horizontal guide (no vertical part).51* It starts at visibleColumn and continues until endColumn.52*/53public readonly horizontalLine: IndentGuideHorizontalLine | null,54/**55* If set (!= -1), only show this guide for wrapped lines that don't contain this model column, but are after it.56*/57public readonly forWrappedLinesAfterColumn: number | -1,58public readonly forWrappedLinesBeforeOrAtColumn: number | -159) {60if ((visibleColumn !== -1) === (column !== -1)) {61throw new Error();62}63}64}6566export class IndentGuideHorizontalLine {67constructor(68public readonly top: boolean,69public readonly endColumn: number,70) { }71}727374