Options
All
  • Public
  • Public/Protected
  • All
Menu

Pair of two positions.

Hierarchy

Index

Constructors

  • new Range(start: Position, end: Position): Range
  • new Range(startLine: number, startCharacter: number, endLine: number, endCharacter: number): Range
  • 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

  • isEqual(other: Range): boolean
  • 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.