A selection in the editor. The selection is a range that has an orientation.

Hierarchy (view full)

Constructors

  • Parameters

    • selectionStartLineNumber: number
    • selectionStartColumn: number
    • positionLineNumber: number
    • positionColumn: number

    Returns Selection

Properties

endColumn: number

Column on which the range ends in line endLineNumber.

endLineNumber: number

Line number on which the range ends.

positionColumn: number

The column on positionLineNumber where the selection has ended.

positionLineNumber: number

The line number on which the selection has ended.

selectionStartColumn: number

The column on selectionStartLineNumber where the selection has started.

selectionStartLineNumber: number

The line number on which the selection has started.

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

  • Create a new empty range using this range's end position.

    Returns Range

  • Create a new empty range using this range's start position.

    Returns Range

  • Test if position is in this range. If the position is at the edges, will return true.

    Parameters

    Returns boolean

  • Test if range is in this range. If the range is equal to this range, will return true.

    Parameters

    Returns boolean

  • Moves the range by the given amount of lines.

    Parameters

    • lineCount: number

    Returns Range

  • Test if this range equals other.

    Parameters

    Returns boolean

  • Test if equals other selection.

    Parameters

    Returns boolean

  • Return the end position (which will be after or equal to the start position)

    Returns Position

  • Get the position at positionLineNumber and positionColumn.

    Returns Position

  • Get the position at the start of the selection.

    Returns Position

  • Return the start position (which will be before or equal to the end position)

    Returns Position

  • Test if this range is empty.

    Returns boolean

  • A reunion of the two ranges. The smallest position will be used as the start point, and the largest one as the end point.

    Parameters

    Returns Range

  • Create a new selection with a different positionLineNumber and positionColumn.

    Parameters

    • endLineNumber: number
    • endColumn: number

    Returns Selection

  • Create a new selection with a different selectionStartLineNumber and selectionStartColumn.

    Parameters

    • startLineNumber: number
    • startColumn: number

    Returns Selection

  • 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

  • Transform to a human-readable representation.

    Returns string

  • Test if the two ranges are intersecting. If the ranges are touching it returns true.

    Parameters

    Returns boolean

  • Create a new empty range using this range's end position.

    Parameters

    Returns Range

  • Create a new empty range using this range's start position.

    Parameters

    Returns Range

  • 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

  • Test if position is in range. If the position is at the edges, will return true.

    Parameters

    Returns boolean

  • Test if otherRange is in range. If the ranges are equal, will return true.

    Parameters

    Returns boolean

  • Create with a direction.

    Parameters

    • startLineNumber: number
    • startColumn: number
    • endLineNumber: number
    • endColumn: number
    • direction: SelectionDirection

    Returns Selection

  • Test if range a equals b.

    Parameters

    Returns boolean

  • Return the end position (which will be after or equal to the start position)

    Parameters

    Returns Position

  • Return the start position (which will be before or equal to the end position)

    Parameters

    Returns Position

  • Test if range is empty.

    Parameters

    Returns boolean

  • Test if obj is an IRange.

    Parameters

    • obj: any

    Returns obj is IRange

  • Test if obj is an ISelection.

    Parameters

    • obj: any

    Returns obj is ISelection

  • Create a Range from an IRange.

    Parameters

    • range: null

    Returns null

  • Parameters

    Returns Range

  • Parameters

    Returns Range

  • Create a Selection from an ISelection.

    Parameters

    Returns Selection

  • A reunion of the two ranges. The smallest position will be used as the start point, and the largest one as the end point.

    Parameters

    Returns Range

  • a equals b.

    Parameters

    Returns boolean

  • Test if the two selections are equal.

    Parameters

    Returns boolean

  • Test if the range spans multiple lines.

    Parameters

    Returns 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