tree-sitter / node-tree-sitter

Node.js bindings for tree-sitter
https://www.npmjs.com/package/tree-sitter
MIT License
649 stars 114 forks source link

Support queries #56

Closed sguillia closed 4 years ago

sguillia commented 4 years ago

Hi!

The tree sitter API allows to search for pattern with queries. I am wondering if it would be feasible to have a binding for this, and how you would approach this if contributors would like to implement it :-)

https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries

sogaiu commented 4 years ago

Have been using web-tree-sitter, but started noticing that the related processes (node in one case, vscode in another) disappear / die. As part of diagnosing the issue, started using the node bindings to compare and haven't yet encountered the same process issues. (Hope to have more to say when details become clearer.)

At any rate, was using the query API via web-tree-sitter and at first glance, that doesn't seem to be here in the node bindings, so here's another vote of interest :)

smackesey commented 4 years ago

It appears that the new Query-related types weren't added to the .d.ts file. No biggie but should be incorporated eventually.