Skip to content

Utilize interior in relative scope modifier - #3122

Merged
AndreasArvidsson merged 17 commits into
mainfrom
relativeScopeInterior
Dec 18, 2025
Merged

AndreasArvidsson merged 17 commits into
mainfrom
relativeScopeInterior

Conversation

@AndreasArvidsson

@AndreasArvidsson AndreasArvidsson commented Dec 13, 2025 •

Copy link
Copy Markdown
Member

By utilizing interior scope in relative scope modifier we can skip the interior of scopes. See new test.

Fixes #2627

@AndreasArvidsson
AndreasArvidsson requested a review from a team as a code owner December 13, 2025 14:13
@AndreasArvidsson

Copy link
Copy Markdown
Member Author

@pokey Mind having a look at this?

pokey
pokey previously approved these changes Dec 14, 2025

@pokey pokey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to say whether this will be nice or annoying in practice. I think worth shipping to find out

@AndreasArvidsson

Copy link
Copy Markdown
Member Author

@pokey Please have another look now.

@pokey

pokey commented Dec 16, 2025

Copy link
Copy Markdown
Member

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?

@AndreasArvidsson

AndreasArvidsson commented Dec 16, 2025 •

Copy link
Copy Markdown
Member Author

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.

@pokey

pokey commented Dec 17, 2025

Copy link
Copy Markdown
Member

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

@AndreasArvidsson
AndreasArvidsson merged commit 2a0ccd6 into main Dec 18, 2025
15 checks passed
@AndreasArvidsson
AndreasArvidsson deleted the relativeScopeInterior branch December 18, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Special handling of previous/next scope when in a code block/body

2 participants