Module: core/updateSelections/updateSelections
Namespaces
Functions
callFunctionAndUpdateRanges
▸ callFunctionAndUpdateRanges(rangeUpdater
, func
, document
, rangeMatrix
): Promise
<Range
[][]>
Parameters
Name | Type |
---|---|
rangeUpdater | RangeUpdater |
func | () => Thenable <void > |
document | TextDocument |
rangeMatrix | readonly 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
Name | Type | Description |
---|---|---|
rangeUpdater | RangeUpdater | A RangeUpdate instance that will perform actual range updating |
func | () => Thenable <void > | The function to call |
document | TextDocument | The document containing the selections |
selectionInfoMatrix | FullSelectionInfo [][] | 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
Name | Type | Description |
---|---|---|
rangeUpdater | RangeUpdater | A RangeUpdate instance that will perform actual range updating |
func | () => Thenable <void > | The function to call |
document | TextDocument | The document containing the selections |
selectionMatrix | readonly 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
Name | Type | Description |
---|---|---|
rangeUpdater | RangeUpdater | A RangeUpdate instance that will perform actual range updating |
func | () => Thenable <void > | The function to call |
document | TextDocument | The document containing the selections |
originalSelections | SelectionsWithBehavior [] | 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
Name | Type | Description |
---|---|---|
document | TextDocument | The document containing the selection |
selection | Selection | The selection |
rangeBehavior | RangeExpansionBehavior | How selection should behave with respect to insertions on either end |
Returns
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
Name | Type | Description |
---|---|---|
rangeUpdater | RangeUpdater | A RangeUpdate instance that will perform actual range updating |
editor | EditableTextEditor | The editor containing the selections |
edits | Edit [] | A list of edits to apply |
originalSelectionInfos | FullSelectionInfo [][] | 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
Name | Type |
---|---|
rangeUpdater | RangeUpdater |
editor | EditableTextEditor |
edits | Edit [] |
originalRanges | readonly Range [][] |
Returns
Promise
<Range
[][]>
Defined in
core/updateSelections/updateSelections.ts:302
performEditsAndUpdateSelectionInfos
▸ performEditsAndUpdateSelectionInfos(rangeUpdater
, editor
, edits
, originalSelectionInfos
): Promise
<Selection
[][]>
Parameters
Name | Type |
---|---|
rangeUpdater | RangeUpdater |
editor | EditableTextEditor |
edits | Edit [] |
originalSelectionInfos | SelectionInfo [][] |
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
Name | Type | Description |
---|---|---|
rangeUpdater | RangeUpdater | A RangeUpdate instance that will perform actual range updating |
editor | EditableTextEditor | The editor containing the selections |
edits | Edit [] | A list of edits to apply |
originalSelections | readonly 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
Name | Type | Description |
---|---|---|
rangeUpdater | RangeUpdater | A RangeUpdate instance that will perform actual range updating |
editor | EditableTextEditor | The editor containing the selections |
edits | Edit [] | A list of edits to apply |
originalSelections | SelectionsWithBehavior [] | The selections to update |
Returns
Promise
<Selection
[][]>
The updated selections
Defined in
core/updateSelections/updateSelections.ts:279