mickeynp / combobulate

Structured Editing and Navigation in Emacs with Tree-Sitter
GNU General Public License v3.0
945 stars 54 forks source link

Query Builder Documentation #54

Closed chookity-pokk closed 1 year ago

chookity-pokk commented 1 year ago

First off, love the tool and the awesome book!

When using the tool though my main interest is using it for querying and I am having trouble finding documentation for how to build a query. I tried using the Emacs Treesitter documentation and those queries don't seem to work a good chunk of the time and the official Treesitter documentation has the same issue. My super basic example is just looking for comments which the Treesitter documentation shows should be (comment)+ here but when I try this in combobulate I get no matches or no @capture groups.

So where can one find a list of capture groups and documentation for the query syntax?

mickeynp commented 1 year ago

Capture groups are free-form. You can pick any name.

chookity-pokk commented 1 year ago

Sorry for the delayed response. So if one wanted to read up on the best way to build a complex query, where would one do that? The official treesitter documentation or the elisp treesitter documentation?

mickeynp commented 1 year ago

Both. Ultimately everything you need to know is documented in the TS documentation, but the elisp one does add more Emacs-specific things you should know.