Skip to content
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

Include macro attributes to impls, structs, enums, functions etc. texobjects #2494

Conversation

andreytkachenko
Copy link
Contributor

@andreytkachenko andreytkachenko commented May 17, 2022

in example like:

/// some doc comment related to struct Test
#[derive(Debug)]
pub struct Test {
    test: u32,
}

the mac selector will select struct with #derive macro and doc comments included

@andreytkachenko andreytkachenko force-pushed the support-unsupported-treesitter-queries branch from a3434c1 to bbf0639 Compare May 17, 2022 20:40
@the-mikedavis the-mikedavis added the S-waiting-on-review Status: Awaiting review from a maintainer. label May 18, 2022
@sudormrfbin sudormrfbin self-requested a review May 18, 2022 04:23
@andreytkachenko andreytkachenko force-pushed the support-unsupported-treesitter-queries branch from bbf0639 to 70c4648 Compare May 18, 2022 05:37
Copy link
Contributor

@pickfire pickfire left a comment

Choose a reason for hiding this comment

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

Looks good to me. But I am not very familiar with textobjects so probably need someone else to approve again.

if nodes.len() > 1 {
Some(CapturedNode::Grouped(nodes))
} else {
nodes.into_iter().map(CapturedNode::Single).next()
Copy link
Contributor

Choose a reason for hiding this comment

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

First time I came across this pattern, looks interesting but I have to take a second look on this to know what it does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do think CaptureNode should be refactored from enum to struct with SmallVec as nodes

@archseer archseer merged commit 62fd1f6 into helix-editor:master May 20, 2022
@andreytkachenko andreytkachenko deleted the support-unsupported-treesitter-queries branch May 20, 2022 09:50
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 15, 2022
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants