You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
syntax: Use matches rather than captures in textobject queries
Previously, `TextObject::capture_nodes` and `capture_nodes_any`
collected the captures within a match for every capture which occurred,
so for a query like
[
(line_comment)
(block_comment)
] @comment.inside
and text like
// comment 1
// comment 2
`capture_nodes` would produce `CaptureNode::Single` for the first
comment and also `CaptureNode::Grouped` for both comments.
Instead we want to have tree-sitter complete the full match and then
consider nodes from the requested capture. Then `capture_nodes` produces
a single `CaptureNode::Grouped` for both comments.
This fixes the behavior of `mac` in languages like Rust.
0 commit comments