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
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
How to create a query
How to capture a node with a query
After capturing a node, how do I get a node inside this result? Python example: if I capture a function/method it's name, parameters and body and my goal is to get the parameter data, how do I get each parameter? Should I just use parameters: (parameters (identifier) (identifier)) @function.parameters and then loop over the result and filter the child nodes via result.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.
How queries work
Thanks.
The text was updated successfully, but these errors were encountered:
Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.61. Please mark this comment with 👍 or 👎 to give our bot feedback!
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?
@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: