Repository navigation
Custom treesitter textobjects not working for some languages #2578
Contributing guidelines
Module(s)mini.ai QuestionI've tried setting up custom tree sitter text objects like described here. These seem to work fine with lua, but with every other language I have tried (javascript, cpp, bash) nvim tells me: (mini.ai) No textobject "iF" found covering region within 50 lines and 'search_method = 'cover_or_next''. Here is my config: I apologize in advance if the problem is super obvious, but I'm not sure what I did wrong. |
Replies: 1 comment 4 replies
|
Hello @KismetPartisan, Thanks for the question! That message can appear when the enclosing function contains a lot of lines. Default In case the above does not apply, perhaps you can look at how its done in MiniMax. Any language added here should work. The suggested config for |
On top of this, I'd draw extra attention to making sure that tree-sitter is actually used in specified languages. On the latest 'nvim-treesitter/nvim-treesitter' those are not automatically enabled and require explicit
vim.treesitter.start()Lua call. I.e. execute:lua vim.treesitter.start()and see if it makes textobjects work (or at least highlighting will likely have changed). The links above show the setup that can do this automatically.The posted config doesn't show it, so my guess would be to first check this.