-
-
Notifications
You must be signed in to change notification settings - Fork 92
Utilize interior in relative scope modifier #3122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@pokey Mind having a look at this? |
pokey
left a comment
There was a problem hiding this 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
| const interiorRanges = Array.from(interiorScopes) | ||
| .filter((s) => !s.domain.contains(initialPosition)) | ||
| .map((s) => s.domain); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
By utilizing interior scope in relative scope modifier we can skip the interior of scopes. See new test.