-
Notifications
You must be signed in to change notification settings - Fork 130
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
Finding function declarations #57
Comments
If you run weggli with verbosity turned on, your query is probably getting normalized into a compound_statement. If you're looking for content outside of a compound_statement, you might be able to trim out that logic in I'm not sure, but you also might need to anchor to a different tree-sitter-c rule which are those things listed in |
Just adding
|
Yeah, agreed. Having variable granularity on what's considered an anchor point when filtering your query is pretty useful. Very cool that it worked out. I've had to patch it similarly so that I could chain queries together via sh pipeline ([definition|specifier] -> [declaration|expression]). Something like that anyways. |
Thanks for the bug report and sorry for the slow response. I didn't have much time to work on weggli in the last weeks. I think disabling the VALID_NODE_KINDS check + anchoring based on a flag would solve this. I'll take a stab at this, but it might take a bit before I find the time. |
I would like to find function declarations only but it seems that weggli does not support this at the moment.
What I have tried:
$ weggli -R func=myFoo '_ $func(_);' .
If this is indeed not supported, an enhancement would be nice even though this may be a little out of scope for the tool (based on its description).
The text was updated successfully, but these errors were encountered: