-
-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Not sure if oneOf is the right name, but we should support a way to compose scope types like the following:
interface OneOfScopeType {
type: "oneOf";
scopeTypes: ScopeType[]
}Then we can construct a OneOfScopeHandler that will behave the same as a hierarchical scope where each scope can be any of scopeTypes. So basically:
getScopesTouchingPosition: return smallest scopes of any ofscopeTypestouching positiongetScopesOverlappingRange: callgetScopesOverlappingRangeon allscopeTypesand then remove any scopes that are contained by another scopegetScopeRelativeToPosition: pick first scope of any of thescopeTypes, then skip it for offset > 1, etciterationScope: applyoneOfto the iteration scopes ofscopeTypes
Use cases
- Add a proper scope type for
"inside"#1046 - Create a smarter iteration scope for "item" #1047
- defining "name" as a union of "class name", "function name", etc
- to define iteration scope of surrounding pair to be union of "inside" and "file"
- users could map a custom scope type Talon side that constructs an
oneOfscope type to enable them to construct their own unions of other scope types - we could maybe map a spoken form
"<scope> or <scope>"to construct these on the fly, eg"take next funk or class"
Possible names
cascadinguniononeOfanyOfor
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request