jihems
jihems

Reputation: 221

VSCode : how to disable doxygen tags highlight in comments?

In VSCode with no extensions, C files are colored as follow :

enter image description here

The red square is where I have an issue. I found it distracting to have comments using the same colors as the source code. I would like to find a way to disable doxygen highlights or, at least, dampen its colors to diminished its visual impact.

In an attempt to dampen it, I have been playing with the editor.tokenColorCustomizations properties (as documented here by Microsoft) to change its colors but I couldn't target the correct group.

A better solution for me would be to disable all Doxygen highlighting. In any way, help will be greatly appreciated !

Upvotes: 6

Views: 2491

Answers (1)

jihems
jihems

Reputation: 221

In a general manner, modifying colors of an item in VSCode editor is the following :

  1. Place cursor on the visually annoying element.
  2. Press Ctrl+Shift+P to access the palette and search for the Developer: Inspect TM Scopes. Select it.
  3. Retrieve information in the bullet list at the bottom of the tooltip.
  4. Write a textMateRules which scope matches the tooltip scope.

In the case of Doxygen, the following Textmate rule in the settings.json file do recolor the Doxygen keywords with a custom color :

"editor.tokenColorCustomizations": {
  "textMateRules": [
    {
      "scope":"storage.type.class.doxygen",
      "settings": {
        "foreground": "#6272A4"
      }
    }
  ]
}

However, this only recolor the @param tag. For the argument name, we should proceed as listed initially and add the following rule to override its theme color :

  {
    "scope": "variable.parameter.c,comment.block.documentation.c",
    "settings": {
      "foreground": "#6272A4"
    }
  }

I hope it will be useful other people. For the record, this problem shows up more when searching for JSDoc instead of Doxygen. This thread and its linked issue allowed me to envision this solution.

Upvotes: 6

Related Questions