Closed
Description
Proposed implementation
- First run
"paint"
- For each scope returned from paint, iterate scopes from surrounding pair using the following hints:
{ "distalPosition": endOfPaintScope,) "includeDescendantScopes": true, }
- Note that we want to use a modified surrounding pair scope handler which uses "inside" as content range
- For each such surrounding pair scope, yield a scope which is the intersection of the surrounding pair scope with the paint scope
- Yield the paint scope itself
- For iteration scope, just use a Implement fallback scope handler #1097 scope combinator which falls back from a version of surrounding pair where the domain is actually just the inside (including whitespace), falling back to "line"
Dependencies
Test cases to add
(using syntax proposed in #1524)
#!! scope: {type: boundedNonWhitespaceSequence}
#!! languageId: plaintext, python, typescript
foo(bar)
#!1 ^^^^^^^^
#!2 ^^^
#!3 ********
#!4 ***
foo(bar baz)
#!1 ^^^^^^^
#!2 ^^^
#!3 ^^^
#!4 ^^^^
#!5 ************
#!6 *******
(foo)bar
#!1 ^^^
#!2 ^^^^^^^^
foo(bar)baz
#!1 ^^^^^^^^^^^
#!2 ^^^
foo( bar )
#!1 ^^^^
#!2 ^^^
#!3 ^
foo(bar )
#!1 ^^^^^^^
#!2 ^^^
#!3 ^
( foo)bar(baz )
#!1 ^
#!2 ^^^
#!3 ^^^^^^^^^^^
#!4 ^^^
#!5 ^
colors.back)ground.dark
#!1 ^^^^^^^^^^^
#!2 ^^^^^^^^^^^^^^^^^^^^^^^
( foo)bar
#!1 ^
#!2 ^^^
#!3 ^^^^^^^
(( foo)bar)baz
#!1 ^^
#!2 ^
#!3 ^^^
#!4 ^^^^^^^
#!5 ^^^^^^^^^^^