Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support semantic highlighting for Doxygen comments #4089

Closed
anatolyburakov opened this issue Aug 15, 2019 · 7 comments
Closed

Please support semantic highlighting for Doxygen comments #4089

anatolyburakov opened this issue Aug 15, 2019 · 7 comments
Labels
Feature: Colorization Feature: Doc comments An issue related to code comments shown in hover, completion, and signature help. Feature Request Language Service
Milestone

Comments

@anatolyburakov
Copy link

Type: LanguageService

By convention, Doxygen comments use special comment signature to indicate Doxygen comment blocks. IDE's like Qt Creator support these and both colorizes Doxygen comments in different color and provides additional syntax colorization for values in the comment:

cpptools-doxygen

This makes it very easy to distinguish normal comments from documentation, and is very easy to spot when you've accidentally created the wrong comment type. It would be good if VSCode supported that as well (generating these from function signature automatically would also be a bonus!).

This is similar to #658, but at issue here is not display of comments, but rather syntax highlighting and colorization for C/C++ Doxygen comments.

@HunterZ
Copy link

HunterZ commented Aug 15, 2019

Note that a triple-slash /// before each line is also commonly used to signal Doxygen comments.

@matter123
Copy link

@anatolyburakov @HunterZ I'm working on Doxygen comment syntax highlighting from the textmate grammar (non-semantic) side. Are you looking for something more comprehensive than the picture in the linked PR. jeff-hykin/better-cpp-syntax#354 (comment). Supports both /** and /// style documentation comments.

@anatolyburakov
Copy link
Author

@matter123 yes it looks great. as long as it's possible to have it as a different color than normal comments, and have even rudimentary syntax highlighting within comments, i'll be quite happy!

@michelleangela michelleangela added this to the Backlog milestone Aug 19, 2019
@matter123
Copy link

matter123 commented Aug 27, 2019

@anatolyburakov @HunterZ with version v1.14.0 of the "Better C++ Syntax" extension, syntax highlighting for Doxygen commands inside documentation comments.

@anatolyburakov You can distinguish documentation comments from normal comments, as documentation comments have the scope comment.block.documentation.cpp. Using the vscode setting "editor.tokenColorCustomizations" you can apply a separate color to those comments

Example: (settings.json)

{
//...
"editor.tokenColorCustomizations": {
  "textmateRules": [
    {
      "name": "doxygen",
      "scope": [ "source.cpp comment.block.documentation" ],
      "settings": {
        "foreground": "#BBBBBB",
      }
    }
  ]
},
//...
}

Screenshot from 2019-08-26 22-58-15

@sean-mcmanus
Copy link
Contributor

Thanks. Sounds like we can close this issue.

@gb-esat
Copy link

gb-esat commented Nov 16, 2019

Would it be possible to support variable highlighting for @param[in,out]? Thanks!

http://www.doxygen.nl/manual/commands.html#cmdparam

Untitled

@matter123
Copy link

@gb-esat Created jeff-hykin/better-cpp-syntax#418 for that

@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: Colorization Feature: Doc comments An issue related to code comments shown in hover, completion, and signature help. Feature Request Language Service
Projects
None yet
Development

No branches or pull requests

6 participants