stsewd / tree-sitter-comment

Tree-sitter grammar for comment tags like TODO, FIXME(user).
https://stsewd.dev/tree-sitter-comment/
MIT License
126 stars 8 forks source link

Not working with PHP in neovim #25

Closed danrot closed 1 year ago

danrot commented 1 year ago

I have installed this grammar in neovim, and would like to use it in PHP. It seems to work in lua:

grafik

However, adding a TODO comment in a PHP file does not work:

grafik

Should this grammar work with every language? I have no idea why it works in Lua but not in PHP...

stsewd commented 1 year ago

Hi, this is because PHP doesn't use the comment parser in PHP comments, but it uses the phpdoc parser, see https://github.com/nvim-treesitter/nvim-treesitter/pull/2280. You could try extending the injections to add the comment grammar, or maybe suggest the change upstream.