@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Interface ActiveTextEditor

    The editor the user is working in, as the framework sees it.

    Reads are pull-based rather than a snapshot: a handler can edit and then read back, and the document may also change underneath it.

    interface ActiveTextEditor {
        languageId: string;
        lineCount: number;
        selections: readonly TextRange[];
        uri: WatchedUri;
        applyEdits(
            edits: readonly TextEdit[],
            options?: TextEditOptions,
        ): Promise<boolean>;
        getText(range?: TextRange): string;
        lineRange(line: number): TextRange | undefined;
        reveal(range: TextRange): void;
        select(selections: readonly TextRange[]): void;
        wordRangeAt(
            position: TextPosition,
            pattern?: RegExp,
        ): TextRange | undefined;
    }
    Index
    languageId: string

    The document's language id, e.g. 'typescript'.

    lineCount: number

    Number of lines. Always at least 1.

    selections: readonly TextRange[]

    The current selections, primary first. Never empty.

    Each is ordered: start never comes after end, even for a right-to-left selection, matching vscode.Selection.start/end. The direction the user dragged in is not something a text operation should have to think about.

    The document's location. untitled: documents have no meaningful path.

    • Applies replacements. Resolves false when the platform refused them.

      An empty batch with an explicit undoStop places that boundary and changes nothing else — which is how a sequence of batches closes its undo step once the last one turns out to have been the last. With no explicit undoStop an empty batch is simply nothing to do.

      Parameters

      Returns Promise<boolean>