Interface IEditorDecorationsCollection

Expand description

A collection of decorations

interface IEditorDecorationsCollection {
    length: number;
    onDidChange: IEvent<IModelDecorationsChangedEvent>;
    append(
        newDecorations: readonly IModelDeltaDecoration[],
    ): string[];
    clear(): void;
    getRange(index: number): Range;
    getRanges(): Range[];
    has(decoration: IModelDecoration): boolean;
    set(
        newDecorations: readonly IModelDeltaDecoration[],
    ): string[];
}

Properties§

§length: number

Get the decorations count.

§readonly onDidChange: IEvent<IModelDecorationsChangedEvent>

An event emitted when decorations change in the editor, but the change is not caused by us setting or clearing the collection.

Methods§

§

append(
    newDecorations: readonly IModelDeltaDecoration[],
): string[]

Append newDecorations to this collection.

§

clear(): void

Remove all previous decorations.

§

getRange(index: number): Range

Get the range for a decoration.

§

getRanges(): Range[]

Get all ranges for decorations.

§

has(decoration: IModelDecoration): boolean

Determine if a decoration is in this collection.

§

set(
    newDecorations: readonly IModelDeltaDecoration[],
): string[]

Replace all previous decorations with newDecorations.