A model that can have decorations.

Hierarchy

  • ITextModelWithDecorations

Index

Methods

deltaDecorations

  • deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[], ownerId?: number): string[]
  • Perform a minimum ammount of operations, in order to transform the decorations identified by oldDecorations to the decorations described by newDecorations and returns the new identifiers associated with the resulting decorations.

    Parameters

    • oldDecorations: string[]

      Array containing previous decorations identifiers.

    • newDecorations: IModelDeltaDecoration[]

      Array describing what decorations should result after the call.

    • Optional ownerId: number

      Identifies the editor id in which these decorations should appear. If no ownerId is provided, the decorations will appear in all editors that attach this model.

    Returns string[]

    An array containing the new decorations identifiers.

getAllDecorations

  • getAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]
  • Gets all the decorations as an array.

    Parameters

    • Optional ownerId: number

      If set, it will ignore decorations belonging to other owners.

    • Optional filterOutValidation: boolean

      If set, it will ignore decorations specific to validation (i.e. warnings, errors).

    Returns IModelDecoration[]

getDecorationOptions

  • Get the options associated with a decoration.

    Parameters

    • id: string

      The decoration id.

    Returns IModelDecorationOptions

    The decoration options or null if the decoration was not found.

getDecorationRange

  • getDecorationRange(id: string): Range
  • Get the range associated with a decoration.

    Parameters

    • id: string

      The decoration id.

    Returns Range

    The decoration range or null if the decoration was not found.

getDecorationsInRange

  • getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]
  • Gets all the deocorations in a range as an array. Only startLineNumber and endLineNumber from range are used for filtering. So for now it returns all the decorations on the same line as range.

    Parameters

    • range: IRange

      The range to search in

    • Optional ownerId: number

      If set, it will ignore decorations belonging to other owners.

    • Optional filterOutValidation: boolean

      If set, it will ignore decorations specific to validation (i.e. warnings, errors).

    Returns IModelDecoration[]

    An array with the decorations

getLineDecorations

  • getLineDecorations(lineNumber: number, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]
  • Gets all the decorations for the line lineNumber as an array.

    Parameters

    • lineNumber: number

      The line number

    • Optional ownerId: number

      If set, it will ignore decorations belonging to other owners.

    • Optional filterOutValidation: boolean

      If set, it will ignore decorations specific to validation (i.e. warnings, errors).

    Returns IModelDecoration[]

    An array with the decorations

getLinesDecorations

  • getLinesDecorations(startLineNumber: number, endLineNumber: number, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]
  • Gets all the decorations for the lines between startLineNumber and endLineNumber as an array.

    Parameters

    • startLineNumber: number

      The start line number

    • endLineNumber: number

      The end line number

    • Optional ownerId: number

      If set, it will ignore decorations belonging to other owners.

    • Optional filterOutValidation: boolean

      If set, it will ignore decorations specific to validation (i.e. warnings, errors).

    Returns IModelDecoration[]

    An array with the decorations