Class: ContainingScopeStage
processTargets/modifiers/ContainingScopeStage.ContainingScopeStage
This modifier stage expands from the input target to the smallest containing scope. We proceed as follows:
- Expand to smallest scope(s) touching start position of input target's content range
- If input target has an empty content range, return the start scope, breaking ties as defined by ScopeHandler.isPreferredOver when more than one scope touches content range
- Otherwise, if end of input target is weakly contained by the domain of the rightmost start scope, return rightmost start scope. We return rightmost because that will have non-empty intersection with input target content range.
- Otherwise, expand from end of input target and form a range from rightmost start scope through leftmost end scope. We use rightmost start scope and leftmost end scope because those will have non-empty intersection with input target content range.
Implements
Constructors
constructor
• new ContainingScopeStage(modifier
)
Parameters
Name | Type |
---|---|
modifier | ContainingScopeModifier |
Defined in
processTargets/modifiers/ContainingScopeStage.ts:36
Methods
run
▸ run(context
, target
): Target
[]
Parameters
Name | Type |
---|---|
context | ProcessedTargetsContext |
target | Target |
Returns
Target
[]
Implementation of
Defined in
processTargets/modifiers/ContainingScopeStage.ts:38