Closed jghauser closed 1 year ago
This is a very weird bug. Looking at this with nvim-treesitter-playground
I can see that this is properly recognized as an (html_tag)
. As such the html parser should be injected which in turn should recognize the comment. It seem though that the html parser is never injected.
So to me it seems to be a bug in neovim or nvim-treesitter though I cannot say that with certainty.
A workaround that I could implement in my grammar, is to add a new node type, let's say (html_comment)
which could be configured in neovim to be highlighted as a comment. In this case the html parser is not needed and everything should work fine.
Just fixed a similar problem for the helix editor in https://github.com/helix-editor/helix/pull/4478, but I think neovim has a different problem with this.
Thanks for the feedback! I can open an issue in nvim-treesitter to see what they think.
Gonna close this, as it seems to be better fixed on the editor and not the parser level, but feel free to reopen if there's still any issue.
Describe the bug
Code example
Expected behavior The comment is highlighted as a comment.
Actual behavior The comment is highlighted as normal text. See this screenshot (with neovim):![20221018_17h14m44s_grim](https://user-images.githubusercontent.com/10319377/196471363-816a225d-4dd4-4fda-8dde-8bf526aa2f3b.jpeg)
This seems similar but not quite the same as #36, though I didn't quite understand what the issue is there (and it's also marked as "invalid").
Highlighting gets applied correctly when I remove the heading and also if there's a comment as the first element of the paragraph.