-
-
Notifications
You must be signed in to change notification settings - Fork 123
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 documentation for how to use Query API #70
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
Hey @kkoomen - I'm really struggling with this as well. I'm hoping comeone could perhaps share a brief example of how to effectively isolate nodes by type and extract their contents using queries in TS/JS? |
As long there is no real documentation yet, you could at least have a look into the tests: https://github.com/tree-sitter/node-tree-sitter/blob/master/test/query_test.js |
@weeman1337 I think by now more people had no choice but to look through tests yet, but there are so many questions and cases that are not covered in those tests. Is there any plan to write documentation? I'm still waiting for this and it seems the development on the tree-sitter modules are slow, including response time from maintainers. Can this be more active as well? |
Hi,
I've noticed that #62 did implement the Query API and I sort of did figure it out on my own by just backtracing the packages, the functions being exposed etc, but only because I couldn't find any documentation on how to use the Query API in JavaScript/TypeScript.
Please add the required documentation in the README about how to use this. I personally feel it should include examples of the following
name
,parameters
andbody
and my goal is to get the parameter data, how do I get each parameter? Should I just useparameters: (parameters (identifier) (identifier)) @function.parameters
and then loop over the result and filter the child nodes viaresult.node.children.filter((node) => node.type === 'identifier')
? Or can this capturing be handled with queries as well? I'd like to get more information about this, since I can't find anything about this.Thanks.
The text was updated successfully, but these errors were encountered: