nvim-treesitter / nvim-treesitter-textobjects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

set_query override json object to block.inner

Willem-J-an opened this issue · comments

I'm trying to override json object textobjects:

(object (_) @block.inner) @block.outer

@block.outer works, but @block.inner does not work. Not sure if I'm doing something wrong, or if this is not possible?

Perhaps I need to do something as below, but whenever I try to add something like that to my override, it complains that this kind of syntax is not valid.

(function_definition
  body: (compound_statement . "{" . (_) @_start @_end (_)? @_end . "}"
 (#make-range! "function.inner" @_start @_end)))

Would appreciate any guidance on this,
Thanks in advance!