Module: processTargets/modifiers/surroundingPair
Functions
processSurroundingPair
▸ processSurroundingPair(context
, editor
, range
, scopeType
): SurroundingPairInfo
| null
Applies the surrounding pair modifier to the given selection. First looks to see if the target is itself adjacent to or contained by a modifier token. If so it will expand the selection to the opposite delimiter token. Otherwise, or if the opposite token wasn't found, it will proceed by finding the smallest pair of delimiters which contains the selection.
Parameters
Name | Type | Description |
---|---|---|
context | ProcessedTargetsContext | Context to be leveraged by modifier |
editor | TextEditor | The editor containing the range |
range | Range | The range to process |
scopeType | SurroundingPairScopeType | The surrounding pair modifier information |
Returns
SurroundingPairInfo
| null
The new selection expanded to the containing surrounding pair or
null
if none was found
Defined in
processTargets/modifiers/surroundingPair/index.ts:30