Documentation Comment highlighting with TreeSitter

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Nutrient – The #1 PDF SDK Library, trusted by 10K+ developers
Other PDF SDKs promise a lot - then break. Laggy scrolling, poor mobile UX, tons of bugs, and lack of support cost you endless frustrations. Nutrient’s SDK handles billion-page workloads - so you don’t have to debug PDFs. Used by ~1 billion end users in more than 150 different countries.
www.nutrient.io
featured
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
  1. nvim-treesitter

    Nvim Treesitter configurations and abstraction layer

    As far as I know there is currently no treesitter parser for Doxygen style comments. There is a language agnostic comment parser that is supported by nvim-treesitter that will highlight things like TODO: and NOTE: in comments. Until this recent commit nvim-treesitter provided a query for this parser that highlighted @ text in comments. It was meant to highlight a reference to a user but it doubled as a doxygen tag highlight for me for a while. I just noticed that this query has been removed and I'm not sure why but you can add it as a custom query in your Neovim config. I have yet to try this so you'll have to refer to the Neovim treesitter docs for where to add the query.

  2. Nutrient

    Nutrient – The #1 PDF SDK Library, trusted by 10K+ developers. Other PDF SDKs promise a lot - then break. Laggy scrolling, poor mobile UX, tons of bugs, and lack of support cost you endless frustrations. Nutrient’s SDK handles billion-page workloads - so you don’t have to debug PDFs. Used by ~1 billion end users in more than 150 different countries.

    Nutrient logo
  3. DoxyGen-Syntax

    DoxyGen Highlighting on top of c/c++/java

    Hey folks, I've been trying to get nvim to highlight the documentation in my codebase. In particular I want keywords like the ones below highlighted in a different colour (@brief, etc). I'm aware there is something similar to this in vim here https://github.com/vim-scripts/DoxyGen-Syntax/tree/master, but to my understanding treesitter disables vim syntax matching and highlighting. Anyone know of a solution?

  4. tree-sitter-comment

    Tree-sitter grammar for comment tags like TODO, FIXME(user).

    As far as I know there is currently no treesitter parser for Doxygen style comments. There is a language agnostic comment parser that is supported by nvim-treesitter that will highlight things like TODO: and NOTE: in comments. Until this recent commit nvim-treesitter provided a query for this parser that highlighted @ text in comments. It was meant to highlight a reference to a user but it doubled as a doxygen tag highlight for me for a while. I just noticed that this query has been removed and I'm not sure why but you can add it as a custom query in your Neovim config. I have yet to try this so you'll have to refer to the Neovim treesitter docs for where to add the query.

  5. lua-language-server

    A language server that offers Lua language support - programmed in Lua

    Lastly, neovim now supports semantic token highlighting which uses semantic tokens from LSP servers to provide even better, language specific highlighting. Some LSP servers support semantic tokens for doc comments. The lua language server is a good example. Unfortunately, if you're using a language like C or C++, the language servers do not provide semantic tokens for comments because doxygen style comments are not specific to those languages so you might be out of luck for semantic token highlighting.

  6. tree-sitter-jsdoc

    JSDoc grammar for Tree-sitter

    No perfect answer but hopefully that helps break things down a bit. Maybe a treesitter parser for doxygen comments could be created similar to this one for jsdoc.

  7. nvim-config

    Not sure for Java (that’s Java right?), but for Python I inject rst in docstring comments. See here for my config.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Use treesitter to jump to next argument without going into nested function calls?

    1 project | /r/neovim | 22 Sep 2023
  • Code navigation ctags/cscope/gnu global alternative?

    1 project | /r/neovim | 16 Sep 2023
  • How to move between the topmost/root node in treesitter?

    1 project | /r/neovim | 20 Jun 2023
  • Vim Tip - Jump to start of function or code block

    1 project | /r/neovim | 19 Apr 2023
  • Getting v(a|i)B working in Ruby?

    1 project | /r/neovim | 15 Apr 2023

Did you know that Lua is
the 18th most popular programming language
based on number of references?