Interface IEditorDecorationsCollection

A collection of decorations

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

Properties

length: number

Get the decorations count.

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 to this collection.

    Parameters

    Returns string[]

  • Remove all previous decorations.

    Returns void

  • Get the range for a decoration.

    Parameters

    • index: number

    Returns Range

  • Get all ranges for decorations.

    Returns Range[]

  • Determine if a decoration is in this collection.

    Parameters

    Returns boolean

  • Replace all previous decorations with newDecorations.

    Parameters

    Returns string[]