Pair of two positions.

Hierarchy (view full)

Constructors

  • Create a new range from two positions. If start is not before or equal to end, the values will be swapped.

    Parameters

    Returns Range

  • Create a new position from coordinates.

    Parameters

    • startLine: number

      a zero based line value

    • startCharacter: number

      a zero based character value

    • endLine: number

      a zero based line value

    • endCharacter: number

      a zero based character value

    Returns Range

Properties

End position.

isEmpty: boolean

true if start and end are equal

isSingleLine: boolean

true if start.line and end.line are equal

start: Position

Start position.

Methods

  • Derived a new range from this range.

    Parameters

    • Optional start: Position

      A position that should be used as start. The default value is the current start.

    • Optional end: Position

      A position that should be used as end. The default value is the current end.

    Returns Range

    A range derived from this range with the given start and end position. If start and end are not different this range will be returned.

  • Derived a new range from this range.

    Parameters

    Returns Range

    A range that reflects the given change. Will return this range if the change is not changing anything.