Skip to main content

Module: core/updateSelections/updateSelections

Namespaces

Functions

callFunctionAndUpdateRanges

callFunctionAndUpdateRanges(rangeUpdater, func, document, rangeMatrix): Promise<Range[][]>

Parameters

NameType
rangeUpdaterRangeUpdater
func() => Thenable<void>
documentTextDocument
rangeMatrixreadonly Range[][]

Returns

Promise<Range[][]>

Defined in

core/updateSelections/updateSelections.ts:166


callFunctionAndUpdateSelectionInfos

callFunctionAndUpdateSelectionInfos(rangeUpdater, func, document, selectionInfoMatrix): Promise<Selection[][]>

Calls the given function and updates the given selections based on the changes that occurred as a result of calling function.

Parameters

NameTypeDescription
rangeUpdaterRangeUpdaterA RangeUpdate instance that will perform actual range updating
func() => Thenable<void>The function to call
documentTextDocumentThe document containing the selections
selectionInfoMatrixFullSelectionInfo[][]A matrix of selection info objects to update

Returns

Promise<Selection[][]>

The initial selections updated based upon what happened in the function

Defined in

core/updateSelections/updateSelections.ts:191


callFunctionAndUpdateSelections

callFunctionAndUpdateSelections(rangeUpdater, func, document, selectionMatrix): Promise<Selection[][]>

Calls the given function and updates the given selections based on the changes that occurred as a result of calling function.

Parameters

NameTypeDescription
rangeUpdaterRangeUpdaterA RangeUpdate instance that will perform actual range updating
func() => Thenable<void>The function to call
documentTextDocumentThe document containing the selections
selectionMatrixreadonly Selection[][]A matrix of selections to update

Returns

Promise<Selection[][]>

The initial selections updated based upon what happened in the function

Defined in

core/updateSelections/updateSelections.ts:147


callFunctionAndUpdateSelectionsWithBehavior

callFunctionAndUpdateSelectionsWithBehavior(rangeUpdater, func, document, originalSelections): Promise<Selection[][]>

Performs a list of edits and returns the given selections updated based on the applied edits

Parameters

NameTypeDescription
rangeUpdaterRangeUpdaterA RangeUpdate instance that will perform actual range updating
func() => Thenable<void>The function to call
documentTextDocumentThe document containing the selections
originalSelectionsSelectionsWithBehavior[]The selections to update

Returns

Promise<Selection[][]>

The updated selections

Defined in

core/updateSelections/updateSelections.ts:218


getSelectionInfo

getSelectionInfo(document, selection, rangeBehavior): FullSelectionInfo

Given a selection, this function creates a SelectionInfo object that can be passed in to any of the commands that update selections.

Parameters

NameTypeDescription
documentTextDocumentThe document containing the selection
selectionSelectionThe selection
rangeBehaviorRangeExpansionBehaviorHow selection should behave with respect to insertions on either end

Returns

FullSelectionInfo

An object that can be used for selection tracking

Defined in

core/updateSelections/updateSelections.ts:31


performEditsAndUpdateFullSelectionInfos

performEditsAndUpdateFullSelectionInfos(rangeUpdater, editor, edits, originalSelectionInfos): Promise<Selection[][]>

Performs a list of edits and returns the given selections updated based on the applied edits

Parameters

NameTypeDescription
rangeUpdaterRangeUpdaterA RangeUpdate instance that will perform actual range updating
editorEditableTextEditorThe editor containing the selections
editsEdit[]A list of edits to apply
originalSelectionInfosFullSelectionInfo[][]The selection info objects to update

Returns

Promise<Selection[][]>

The updated selections

Defined in

core/updateSelections/updateSelections.ts:359


performEditsAndUpdateRanges

performEditsAndUpdateRanges(rangeUpdater, editor, edits, originalRanges): Promise<Range[][]>

Parameters

NameType
rangeUpdaterRangeUpdater
editorEditableTextEditor
editsEdit[]
originalRangesreadonly Range[][]

Returns

Promise<Range[][]>

Defined in

core/updateSelections/updateSelections.ts:302


performEditsAndUpdateSelectionInfos

performEditsAndUpdateSelectionInfos(rangeUpdater, editor, edits, originalSelectionInfos): Promise<Selection[][]>

Parameters

NameType
rangeUpdaterRangeUpdater
editorEditableTextEditor
editsEdit[]
originalSelectionInfosSelectionInfo[][]

Returns

Promise<Selection[][]>

Defined in

core/updateSelections/updateSelections.ts:334


performEditsAndUpdateSelections

performEditsAndUpdateSelections(rangeUpdater, editor, edits, originalSelections): Promise<Selection[][]>

Performs a list of edits and returns the given selections updated based on the applied edits

Parameters

NameTypeDescription
rangeUpdaterRangeUpdaterA RangeUpdate instance that will perform actual range updating
editorEditableTextEditorThe editor containing the selections
editsEdit[]A list of edits to apply
originalSelectionsreadonly Selection[][]The selections to update

Returns

Promise<Selection[][]>

The updated selections

Defined in

core/updateSelections/updateSelections.ts:250


performEditsAndUpdateSelectionsWithBehavior

performEditsAndUpdateSelectionsWithBehavior(rangeUpdater, editor, edits, originalSelections): Promise<Selection[][]>

Performs a list of edits and returns the given selections updated based on the applied edits

Parameters

NameTypeDescription
rangeUpdaterRangeUpdaterA RangeUpdate instance that will perform actual range updating
editorEditableTextEditorThe editor containing the selections
editsEdit[]A list of edits to apply
originalSelectionsSelectionsWithBehavior[]The selections to update

Returns

Promise<Selection[][]>

The updated selections

Defined in

core/updateSelections/updateSelections.ts:279