src/vs/editor/common/textModelGuides.ts
72 LOC · 51 covered · 21 uncovered · 3 ranges · 1708 concepts · 1 introducers · 861 tests
File neighbourhood
The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.
Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.
/*---------------------------------------------------------------------------------------------
textModel.ts ×190
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IPosition } from './core/position.js';
export interface IGuidesTextModelPart {
/**
* @internal
*/
getActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;
/**
* @internal
*/
getLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[];
/**
* Requests the indent guides for the given range of lines.
* `result[i]` will contain the indent guides of the `startLineNumber + i`th line.
* @internal
*/
getLinesBracketGuides(startLineNumber: number, endLineNumber: number, activePosition: IPosition | null, options: BracketGuideOptions): IndentGuide[][];
}
export interface IActiveIndentGuideInfo {
startLineNumber: number;
endLineNumber: number;
indent: number;
}
export enum HorizontalGuidesState {
Disabled,
EnabledForActive,
Enabled
}
export interface BracketGuideOptions {
includeInactive: boolean;
horizontalGuides: HorizontalGuidesState;
highlightActive: boolean;
}
export class IndentGuide {
constructor(
public readonly visibleColumn: number | -1,
public readonly column: number | -1,
public readonly className: string,
/**
* If set, this indent guide is a horizontal guide (no vertical part).
* It starts at visibleColumn and continues until endColumn.
*/
public readonly horizontalLine: IndentGuideHorizontalLine | null,
/**
* If set (!= -1), only show this guide for wrapped lines that don't contain this model column, but are after it.
*/
public readonly forWrappedLinesAfterColumn: number | -1,
public readonly forWrappedLinesBeforeOrAtColumn: number | -1
) {
if ((visibleColumn !== -1) === (column !== -1)) {
throw new Error();
}
}
export class IndentGuideHorizontalLine {
constructor(
public readonly top: boolean,
public readonly endColumn: number,
) { }