-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add contiguous scope modifier #1835
Comments
FWIW, in the Go ast, contiguous blocks of comments are called comment groups. I too would like to be able to operate on comment groups. General purpose slurp is an interesting idea. It would be useful to think of other scopes that it might apply to / other use cases where it is distinct from “every”. |
If slurp does not ignore commenst, I guess it could be used for things like taking items between one comment and the next comment, which sounds like a reasonably common task, for example, in a list of test cases, organized into groups separated by comments. |
This comment was marked as resolved.
This comment was marked as resolved.
I've already suggested a definition in my code examples. I propose to define it as when two instances of the same scope have intersecting trailing/leading ranges. |
Could be used for example targeting multiple contiguous line comments.
"comment slurp comments fine"
Potential solution
I was thinking that this could be implemented around the existing scope handlers similar to how the every modifier works and just join scopes/targets based on leading and trailing delimiter ranges.
Thinks to discuss
"take slurp tokens"
join all tokens in the file and therefore take the entire file."every slurp <scope>"
?The text was updated successfully, but these errors were encountered: