Skip to content

Conversation

@AndreasArvidsson
Copy link
Member

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

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

@pokey Mind having a look at this?

Copy link
Member

@pokey pokey left a comment

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

Comment on lines +214 to +216
const interiorRanges = Array.from(interiorScopes)
.filter((s) => !s.domain.contains(initialPosition))
.map((s) => s.domain);
Copy link
Member

Choose a reason for hiding this comment

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

Nitpicking here but might as well do map / filter on the stream then convert to list at the end

},
);

// Interiors containing the initial position are excluded
Copy link
Member

Choose a reason for hiding this comment

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

Does this actually happen in practice? Prob no harm leaving it but I wouldn't expect it to actually happen

return islice(scopes, offset - 1, offset + desiredScopeCount - 1);
}

function getInteriorRanges(
Copy link
Member

Choose a reason for hiding this comment

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

Could use a jsdoc and a better name. Maybe like "getScopeInteriorRanges"? It's getting the top-level interior ranges for this scope right?

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.

3 participants