[feature] cmake comment
#[=======================================================================[.rst:
The docs
#]=======================================================================]
Cmake comment can inject some other languages. Should we create a cmake-comment parser for it?
This maybe is doable by modifying the scanner to emit more details about bracket comments (having something like open bracket, content, close bracket) and then queries can be written taking advantage of that. I'll try to do it when I have some time.
This should be possible now with e51a18b037aad13676eb1a38ff1a6a207a3abbe7, you just need to write a query to inject the language. Let me know if you need any help.
Can it be out-of-box in neovim's tree-sitter?
It’s possible but I don’t think this is common enough to warrant adding it to nvim-treesitter. I haven’t seen this until you mention it. So I think it’s better if you add the injection to your own config. I can help you with that if you want.
warrant adding it to nvim-treesitter
It depends maintainers of nvim-treesitter?
add the injection to your own config
A wiki should be welcome. :smile:
It depends maintainers of nvim-treesitter?
Not really, the nvim-treesitter maintainers rely on the parser authors to make sense of the queries also, and I right now don't really see this use case being fitting enough.
A wiki should be welcome. 😄
The instruction is at https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#adding-queries but I can add a wiki page for this also.