Skip to main content

Class: RangeUpdater

core/updateSelections/RangeUpdater.RangeUpdater

Constructors

constructor

new RangeUpdater()

Defined in

core/updateSelections/RangeUpdater.ts:22

Properties

disposable

Private disposable: Disposable

Defined in

core/updateSelections/RangeUpdater.ts:20


rangeInfoLists

Private rangeInfoLists: Map<string, FullRangeInfo[][]>

Defined in

core/updateSelections/RangeUpdater.ts:18


replaceEditLists

Private replaceEditLists: Map<string, Edit[][]>

Defined in

core/updateSelections/RangeUpdater.ts:19

Methods

dispose

dispose(): void

Returns

void

Defined in

core/updateSelections/RangeUpdater.ts:119


documentRangeInfoGenerator

Private documentRangeInfoGenerator(document): Generator<FullRangeInfo, void, unknown>

Parameters

NameType
documentTextDocument

Returns

Generator<FullRangeInfo, void, unknown>

Defined in

core/updateSelections/RangeUpdater.ts:82


getDocumentRangeInfoLists

Private getDocumentRangeInfoLists(document): FullRangeInfo[][]

Parameters

NameType
documentTextDocument

Returns

FullRangeInfo[][]

Defined in

core/updateSelections/RangeUpdater.ts:26


getDocumentReplaceEditLists

Private getDocumentReplaceEditLists(document): Edit[][]

Parameters

NameType
documentTextDocument

Returns

Edit[][]

Defined in

core/updateSelections/RangeUpdater.ts:30


listenForDocumentChanges

Private listenForDocumentChanges(): void

Returns

void

Defined in

core/updateSelections/RangeUpdater.ts:92


registerRangeInfoList

registerRangeInfoList(document, rangeInfoList): () => void

Registers a list of range infos to be kept up to date. It is ok to add to this list after registering it; any items in the list at the time of a document change will be kept up to date. Please be sure to call the returned deregister function when you no longer need the ranges updated.

Parameters

NameTypeDescription
documentTextDocumentThe document containing the ranges
rangeInfoListFullRangeInfo[]The ranges to keep up to date; it is ok to add to this list after the fact

Returns

fn

A function that can be used to deregister the list

▸ (): void

Registers a list of range infos to be kept up to date. It is ok to add to this list after registering it; any items in the list at the time of a document change will be kept up to date. Please be sure to call the returned deregister function when you no longer need the ranges updated.

Returns

void

A function that can be used to deregister the list

Defined in

core/updateSelections/RangeUpdater.ts:44


registerReplaceEditList

registerReplaceEditList(document, replaceEditList): () => void

Registers a list of edits to treat as replace edits. These edits are insertions that will not shift an empty selection to the right. Call this function before applying your edits to the document

Note that if you make two edits at the same location with the same text, it is not possible to mark only one of them as replace edit.

It is ok to add to this list after registering it; any items in the list at the time of a document change will be treated as replace edits. Please be sure to call the returned deregister function after you have waited for your edits to be applied.

Parameters

NameTypeDescription
documentTextDocumentThe document containing the ranges
replaceEditListEdit[]A list of edits to treat as replace edits; it is ok to add to this list after the fact

Returns

fn

A function that can be used to deregister the list

▸ (): void

Registers a list of edits to treat as replace edits. These edits are insertions that will not shift an empty selection to the right. Call this function before applying your edits to the document

Note that if you make two edits at the same location with the same text, it is not possible to mark only one of them as replace edit.

It is ok to add to this list after registering it; any items in the list at the time of a document change will be treated as replace edits. Please be sure to call the returned deregister function after you have waited for your edits to be applied.

Returns

void

A function that can be used to deregister the list

Defined in

core/updateSelections/RangeUpdater.ts:71