Interface IEditOperationBuilder

Expand description

A builder and helper for edit operations for a command.

interface IEditOperationBuilder {
    addEditOperation(
        range: IRange,
        text: string,
        forceMoveMarkers?: boolean,
    ): void;
    addTrackedEditOperation(
        range: IRange,
        text: string,
        forceMoveMarkers?: boolean,
    ): void;
    trackSelection(
        selection: Selection,
        trackPreviousOnEmpty?: boolean,
    ): string;
}

Methods§

§

addEditOperation(
    range: IRange,
    text: string,
    forceMoveMarkers?: boolean,
): void

Add a new edit operation (a replace operation).

§

addTrackedEditOperation(
    range: IRange,
    text: string,
    forceMoveMarkers?: boolean,
): void

Add a new edit operation (a replace operation). The inverse edits will be accessible in ICursorStateComputerData.getInverseEditOperations()

§

trackSelection(
    selection: Selection,
    trackPreviousOnEmpty?: boolean,
): string

Track selection when applying edit operations. A best effort will be made to not grow/expand the selection. An empty selection will clamp to a nearby character.