Options
All
  • Public
  • Public/Protected
  • All
Menu

A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)

Hierarchy

Index

Constructors

  • new Range(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number): Range

Properties

endColumn: number

Column on which the range ends in line endLineNumber.

endLineNumber: number

Line number on which the range ends.

startColumn: number

Column on which the range starts in line startLineNumber (starts at 1).

startLineNumber: number

Line number on which the range starts (starts at 1).

Methods

  • containsPosition(position: IPosition): boolean
  • containsRange(range: IRange): boolean
  • equalsRange(other: IRange): boolean
  • isEmpty(): boolean
  • setEndPosition(endLineNumber: number, endColumn: number): Range
  • Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.

    Parameters

    • endLineNumber: number
    • endColumn: number

    Returns Range

  • setStartPosition(startLineNumber: number, startColumn: number): Range
  • Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.

    Parameters

    • startLineNumber: number
    • startColumn: number

    Returns Range

  • strictContainsRange(range: IRange): boolean
  • Test if range is strictly in this range. range must start after and end before this range for the result to be true.

    Parameters

    Returns boolean

  • toString(): string
  • A function that compares ranges, useful for sorting ranges It will first compare ranges on the endPosition and then on the startPosition

    Parameters

    Returns number

  • A function that compares ranges, useful for sorting ranges It will first compare ranges on the startPosition and then on the endPosition

    Parameters

    Returns number

  • isEmpty(range: IRange): boolean
  • isIRange(obj: any): obj is IRange
  • spansMultipleLines(range: IRange): boolean
  • strictContainsRange(range: IRange, otherRange: IRange): boolean
  • Test if otherRange is strictly in range (must start after, and end before). If the ranges are equal, will return false.

    Parameters

    Returns boolean