uncenter / tree-sitter-tera

⛩️ Tree-sitter grammar for the Tera templating language
MIT License
6 stars 1 forks source link

Add textobject queries #6

Open uncenter opened 1 month ago

uncenter commented 1 month ago
uncenter commented 1 month ago

Came up with the following, unsure how to test it / verify it works.

(macro_statement
  body: (_) @function.inside) @function.around

(comment_tag) @comment.inside
(comment_tag)+ @comment.around

(argument_list
  ((_) @parameter.inside . ","? @parameter.around) @parameter.around)

(array (_) @entry.around)
uncenter commented 1 month ago

https://github.com/nvim-treesitter/nvim-treesitter-textobjects details some different accepted captures using "inner" instead of "inside" and "outer" instead of "around".