Closed BastiDood closed 3 years ago
Hi, this case is already covered by the current syntax https://github.com/stsewd/tree-sitter-comment#syntax
For example, using nvim-treesitter you get this
That's strange... Mine doesn't get highlighted. I'm currently using the latest stable Neovim (v0.5.0). Running :checkhealth nvim-treesitter
and :checkhealth treesitter
don't indicate any errors as well. As far as I know, I have enabled the highlighting module. Is there some configuration option I may have missed?
require'nvim-treesitter.configs'.setup {
highlight = { enable = true }
}
Also, thanks for the quick response!
@Some-Dood do you have the comment parser installed? That's :TSInstall comment
, it could also have been overridden by the colorsheme you are using.
Yup, :TSInstall comment
compiles just fine. And yes, you are correct about the color scheme. During the upgrade to the stable v0.5.0, I have forgotten to migrate to the modern color schemes for the One Dark theme. Indeed, as soon as I switched over, everything worked as expected. Thank you very much for your help!
Hello there! It was mentioned in the README that this project is open to suggestions regarding popular comment conventions in other languages. I would like to propose adding highlighting support for "safety comments", a convention that is particularly prevalent among Rust programmers. Safety comments communicate why certain usage of
unsafe
code indeed does not violate invariants relied upon by the compiler and depended libraries. An example of such usage is given below:As illustrated above, the keyword I am proposing to add is
SAFETY
. It would be really neat for safety comments to pop out considering how critical they are to enforcing correctness in code. Thanks!