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

Hierarchy

Index

Constructors

constructor

  • new Selection(selectionStartLineNumber: number, selectionStartColumn: number, positionLineNumber: number, positionColumn: number): Selection

Properties

endColumn

endColumn: number

Column on which the range ends in line endLineNumber.

endLineNumber

endLineNumber: number

Line number on which the range ends.

positionColumn

positionColumn: number

The column on positionLineNumber where the selection has ended.

positionLineNumber

positionLineNumber: number

The line number on which the selection has ended.

selectionStartColumn

selectionStartColumn: number

The column on selectionStartLineNumber where the selection has started.

selectionStartLineNumber

selectionStartLineNumber: number

The line number on which the selection has started.

startColumn

startColumn: number

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

startLineNumber

startLineNumber: number

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

Methods

clone

cloneRange

collapseToStart

  • collapseToStart(): Range

containsPosition

  • containsPosition(position: IPosition): boolean

containsRange

  • containsRange(range: IRange): boolean

equalsRange

  • equalsRange(other: IRange): boolean

equalsSelection

getDirection

  • getDirection(): SelectionDirection.LTR | SelectionDirection.RTL
  • Get directions (LTR or RTL).

    Returns SelectionDirection.LTR | SelectionDirection.RTL

getEndPosition

getPosition

getStartPosition

intersectRanges

isEmpty

  • isEmpty(): boolean

plusRange

  • 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

setEndPosition

  • setEndPosition(endLineNumber: number, endColumn: number): Selection

setStartPosition

  • setStartPosition(startLineNumber: number, startColumn: number): Selection
  • Create a new selection with a different selectionStartLineNumber and selectionStartColumn.

    Parameters

    • startLineNumber: number
    • startColumn: number

    Returns Selection

toString

  • toString(): string

Static areIntersectingOrTouching

Static collapseToStart

Static compareRangesUsingEnds

Static compareRangesUsingStarts

Static containsPosition

Static containsRange

Static createWithDirection

  • createWithDirection(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, direction: SelectionDirection.LTR | SelectionDirection.RTL): Selection
  • Create with a direction.

    Parameters

    • startLineNumber: number
    • startColumn: number
    • endLineNumber: number
    • endColumn: number
    • direction: SelectionDirection.LTR | SelectionDirection.RTL

    Returns Selection

Static equalsRange

Static fromPositions

Static intersectRanges

Static isEmpty

  • isEmpty(range: IRange): boolean

Static isIRange

  • isIRange(obj: any): boolean

Static isISelection

  • isISelection(obj: any): boolean
  • Test if obj is an ISelection.

    Parameters

    • obj: any

    Returns boolean

Static lift

Static liftSelection

Static plusRange

Static selectionsArrEqual

  • selectionsArrEqual(a: ISelection[], b: ISelection[]): boolean
  • a equals b.

    Parameters

    • a: ISelection[]
    • b: ISelection[]

    Returns boolean

Static selectionsEqual

Static spansMultipleLines

  • spansMultipleLines(range: IRange): boolean