Utilize interior in relative scope modifier#3122
Conversation
|
@pokey Mind having a look at this? |
pokey
left a comment
There was a problem hiding this comment.
Hard to say whether this will be nice or annoying in practice. I think worth shipping to find out
packages/cursorless-engine/src/processTargets/modifiers/RelativeScopeStage.ts
Outdated
Show resolved
Hide resolved
packages/cursorless-engine/src/processTargets/modifiers/RelativeScopeStage.ts
Outdated
Show resolved
Hide resolved
packages/cursorless-engine/src/processTargets/modifiers/RelativeScopeStage.ts
Outdated
Show resolved
Hide resolved
|
@pokey Please have another look now. |
|
Ok I made some tweaks. I expanded the comment with an example, and then tweaked the range exclusion: I think we should exclude the target ranges rather than the domain. Wdyt? |
|
I like your changes. The only thing still on my mind is if we really want to use itertools. At most ifilter can remove a single scope. I think for readability reasons we should probably just go back to normal array operations. edit: The more I think about it the more I think using itertools is just a premature optimization. I'm leaning towards readability here. |
It's unfortunate that there's a readability difference, because there's really no good reason for it. They're doing the exact same thing. But yeah I agree the function chain using built-ins is a bit easier to read so I'm fine either way |
By utilizing interior scope in relative scope modifier we can skip the interior of scopes. See new test.
Fixes #2627