Class Range
Expand description
Constructors§
Properties§
readonly end Column: numberColumn on which the range ends in line endLineNumber.
readonly end Line Number: numberLine number on which the range ends.
readonly start Column: numberColumn on which the range starts in line startLineNumber (starts at 1).
readonly start Line Number: numberLine number on which the range starts (starts at 1).
Methods§
§containsPosition(position: IPosition): boolean
containsPosition(position: IPosition): boolean
Test if position is in this range. If the position is at the edges, will return true.
§containsRange(range: IRange): boolean
containsRange(range: IRange): boolean
Test if range is in this range. If the range is equal to this range, will return true.
§getEndPosition(): Position
getEndPosition(): Position
Return the end position (which will be after or equal to the start position)
§getStartPosition(): Position
getStartPosition(): Position
Return the start position (which will be before or equal to the end position)
§isEmpty(): boolean
isEmpty(): boolean
Test if this range is empty.
§isSingleLine(): boolean
isSingleLine(): boolean
§plusRange(range: IRange): Range
plusRange(range: IRange): Range
A reunion of the two ranges. The smallest position will be used as the start point, and the largest one as the end point.
§setEndPosition(
endLineNumber: number,
endColumn: number,
): Range
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.
§setStartPosition(
startLineNumber: number,
startColumn: number,
): 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.
§strictContainsRange(range: IRange): boolean
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.
§toString(): string
toString(): string
Transform to a user presentable string representation.
§areIntersecting(a: IRange, b: IRange): boolean
areIntersecting(a: IRange, b: IRange): boolean
Test if the two ranges are intersecting. If the ranges are touching it returns true.
§areIntersectingOrTouching(a: IRange, b: IRange): boolean
areIntersectingOrTouching(a: IRange, b: IRange): boolean
Test if the two ranges are touching in any way.
§areOnlyIntersecting(a: IRange, b: IRange): boolean
areOnlyIntersecting(a: IRange, b: IRange): boolean
Test if the two ranges are intersecting, but not touching at all.
§compareRangesUsingEnds(a: IRange, b: IRange): number
compareRangesUsingEnds(a: IRange, b: IRange): number
A function that compares ranges, useful for sorting ranges It will first compare ranges on the endPosition and then on the startPosition
§compareRangesUsingStarts(a: IRange, b: IRange): number
compareRangesUsingStarts(a: IRange, b: IRange): number
A function that compares ranges, useful for sorting ranges It will first compare ranges on the startPosition and then on the endPosition
§containsPosition(
range: IRange,
position: IPosition,
): boolean
containsPosition(
range: IRange,
position: IPosition,
): boolean
Test if position is in range. If the position is at the edges, will return true.
§containsRange(range: IRange, otherRange: IRange): boolean
containsRange(range: IRange, otherRange: IRange): boolean
Test if otherRange is in range. If the ranges are equal, will return true.
§getEndPosition(range: IRange): Position
getEndPosition(range: IRange): Position
Return the end position (which will be after or equal to the start position)
§getStartPosition(range: IRange): Position
getStartPosition(range: IRange): Position
Return the start position (which will be before or equal to the end position)
§lift(range: null): null
lift(range: null): null
Create a Range from an IRange.
A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)