Liking cljdoc? Tell your friends :D

dots.vscode.range

A range represents an ordered pair of two positions. It is guaranteed that {@link Range.start start}.isBeforeOrEqual({@link Range.end end})

Range objects are immutable. Use the {@link Range. with with}, {@link Range.intersection intersection}, or {@link Range.union union} methods to derive new ranges from an existing range.

A range represents an ordered pair of two positions.
It is guaranteed that {@link Range.start start}.isBeforeOrEqual({@link Range.end end})

Range objects are __immutable__. Use the {@link Range. with with},
{@link Range.intersection intersection}, or {@link Range.union union} methods
to derive new ranges from an existing range.
raw docstring

contains?cljs

(contains? range position-or-range)

Check if a position or a range is contained in this range.

Parameters:

  • position-or-range: Range | Position - A position or a range.

Returns: boolean - true if the position or range is inside or equal to this range.

Check if a position or a range is contained in this range.

**Parameters:**
- `position-or-range`: `Range | Position` - A position or a range.

**Returns:** `boolean` - `true` if the position or range is inside or equal
to this range.
sourceraw docstring

empty?cljs

(empty? range)

true if start and end are equal.

Returns: boolean

`true` if `start` and `end` are equal.

**Returns:** `boolean`
sourceraw docstring

endcljs

(end range)

The end position. It is after or equal to {@link Range.start start}.

Returns: Position

The end position. It is after or equal to {@link Range.start start}.

**Returns:** `Position`
sourceraw docstring

equal?cljs

(equal? range other)

Check if other equals this range.

Parameters:

  • other: Range - A range.

Returns: boolean - true when start and end are {@link Position.isEqualequal} to start and end of this range.

Check if `other` equals this range.

**Parameters:**
- `other`: `Range` - A range.

**Returns:** `boolean` - `true` when start and end are {@link Position.isEqualequal} to
start and end of this range.
sourceraw docstring

intersectioncljs

(intersection this-range range)

Intersect range with this range and returns a new range or undefined if the ranges have no overlap.

Parameters:

  • range: Range - A range.

Returns: Range | undefined - A range of the greater start and smaller end positions. Will return undefined when there is no overlap.

Intersect `range` with this range and returns a new range or `undefined`
if the ranges have no overlap.

**Parameters:**
- `range`: `Range` - A range.

**Returns:** `Range | undefined` - A range of the greater start and smaller end positions. Will
return undefined when there is no overlap.
sourceraw docstring

set-is-empty!cljs

(set-is-empty! range value)

true if start and end are equal.

`true` if `start` and `end` are equal.
sourceraw docstring

set-is-single-line!cljs

(set-is-single-line! range value)

true if start.line and end.line are equal.

`true` if `start.line` and `end.line` are equal.
sourceraw docstring

single-line?cljs

(single-line? range)

true if start.line and end.line are equal.

Returns: boolean

`true` if `start.line` and `end.line` are equal.

**Returns:** `boolean`
sourceraw docstring

startcljs

(start range)

The start position. It is before or equal to {@link Range.end end}.

Returns: Position

The start position. It is before or equal to {@link Range.end end}.

**Returns:** `Position`
sourceraw docstring

unioncljs

(union range other)

Compute the union of other with this range.

Parameters:

  • other: Range - A range.

Returns: Range - A range of smaller start position and the greater end position.

Compute the union of `other` with this range.

**Parameters:**
- `other`: `Range` - A range.

**Returns:** `Range` - A range of smaller start position and the greater end position.
sourceraw docstring

withcljs

(with range)
(with range change)
(with range start)
(with range start end)

Derived a new range from this range.

Parameters:

  • change: { start?: Position | undefined; end?: Position | undefined; } - An object that describes a change to this range.
  • start: Position | undefined - A position that should be used as start. The default value is the {@link Range.start current start}.
  • end: Position | undefined - A position that should be used as end. The default value is the {@link Range.end current end}.

Returns: Range - A range that reflects the given change. Will return this range if the change is not changing anything.

Derived a new range from this range.

**Parameters:**
- `change`: `{ start?: Position | undefined; end?: Position | undefined; }` - An object that describes a change to this range.
- `start`: `Position | undefined` - A position that should be used as start. The default value is the {@link Range.start current start}.
- `end`: `Position | undefined` - A position that should be used as end. The default value is the {@link Range.end current end}.

**Returns:** `Range` - A range that reflects the given change. Will return `this` range if the change
is not changing anything.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close