Liking cljdoc? Tell your friends :D

dots.vscode.position

Represents a line and character position, such as the position of the cursor.

Position objects are immutable. Use the {@link Position. with with} or {@link Position.translate translate} methods to derive new positions from an existing position.

Represents a line and character position, such as
the position of the cursor.

Position objects are __immutable__. Use the {@link Position. with with} or
{@link Position.translate translate} methods to derive new positions
from an existing position.
raw docstring

after-or-equal?cljs

(after-or-equal? position other)

Check if this position is after or equal to other.

Parameters:

  • other: Position - A position.

Returns: boolean - true if position is on a greater line or on the same line on a greater or equal character.

Check if this position is after or equal to `other`.

**Parameters:**
- `other`: `Position` - A position.

**Returns:** `boolean` - `true` if position is on a greater line
or on the same line on a greater or equal character.
sourceraw docstring

after?cljs

(after? position other)

Check if this position is after other.

Parameters:

  • other: Position - A position.

Returns: boolean - true if position is on a greater line or on the same line on a greater character.

Check if this position is after `other`.

**Parameters:**
- `other`: `Position` - A position.

**Returns:** `boolean` - `true` if position is on a greater line
or on the same line on a greater character.
sourceraw docstring

before-or-equal?cljs

(before-or-equal? position other)

Check if this position is before or equal to other.

Parameters:

  • other: Position - A position.

Returns: boolean - true if position is on a smaller line or on the same line on a smaller or equal character.

Check if this position is before or equal to `other`.

**Parameters:**
- `other`: `Position` - A position.

**Returns:** `boolean` - `true` if position is on a smaller line
or on the same line on a smaller or equal character.
sourceraw docstring

before?cljs

(before? position other)

Check if this position is before other.

Parameters:

  • other: Position - A position.

Returns: boolean - true if position is on a smaller line or on the same line on a smaller character.

Check if this position is before `other`.

**Parameters:**
- `other`: `Position` - A position.

**Returns:** `boolean` - `true` if position is on a smaller line
or on the same line on a smaller character.
sourceraw docstring

charactercljs

(character position)

The zero-based character value.

Returns: number

The zero-based character value.

**Returns:** `number`
sourceraw docstring

compare-tocljs

(compare-to position other)

Compare this to other.

Parameters:

  • other: Position - A position.

Returns: number - A number smaller than zero if this position is before the given position, a number greater than zero if this position is after the given position, or zero when this and the given position are equal.

Compare this to `other`.

**Parameters:**
- `other`: `Position` - A position.

**Returns:** `number` - A number smaller than zero if this position is before the given position,
a number greater than zero if this position is after the given position, or zero when
this and the given position are equal.
sourceraw docstring

equal?cljs

(equal? position other)

Check if this position is equal to other.

Parameters:

  • other: Position - A position.

Returns: boolean - true if the line and character of the given position are equal to the line and character of this position.

Check if this position is equal to `other`.

**Parameters:**
- `other`: `Position` - A position.

**Returns:** `boolean` - `true` if the line and character of the given position are equal to
the line and character of this position.
sourceraw docstring

linecljs

(line position)

The zero-based line value.

Returns: number

The zero-based line value.

**Returns:** `number`
sourceraw docstring

translatecljs

(translate position)
(translate position change)
(translate position line-delta)
(translate position line-delta character-delta)

Create a new position relative to this position. Derived a new position relative to this position.

Parameters:

  • change: { lineDelta?: number | undefined; characterDelta?: number | undefined; } - An object that describes a delta to this position.
  • line-delta: number | undefined - Delta value for the line value, default is 0.
  • character-delta: number | undefined - Delta value for the character value, default is 0.

Returns: Position - A position that reflects the given delta. Will return this position if the change is not changing anything.

Create a new position relative to this position.
Derived a new position relative to this position.

**Parameters:**
- `change`: `{ lineDelta?: number | undefined; characterDelta?: number | undefined; }` - An object that describes a delta to this position.
- `line-delta`: `number | undefined` - Delta value for the line value, default is `0`.
- `character-delta`: `number | undefined` - Delta value for the character value, default is `0`.

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

withcljs

(with position)
(with position change)
(with position line)
(with position line character)

Create a new position derived from this position. Derived a new position from this position.

Parameters:

  • change: { line?: number | undefined; character?: number | undefined; } - An object that describes a change to this position.
  • line: number | undefined - Value that should be used as line value, default is the {@link Position.line existing value}
  • character: number | undefined - Value that should be used as character value, default is the {@link Position.character existing value}

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

Create a new position derived from this position.
Derived a new position from this position.

**Parameters:**
- `change`: `{ line?: number | undefined; character?: number | undefined; }` - An object that describes a change to this position.
- `line`: `number | undefined` - Value that should be used as line value, default is the {@link Position.line existing value}
- `character`: `number | undefined` - Value that should be used as character value, default is the {@link Position.character existing value}

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

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

× close