3

I'm trying to have different colors of text in the XML doc comment like how the word true, false and Window are in blue and green colors in the picture below.

Colored XML documentation comments

I tried decompiling the code that had these but the xml doc was different and there's no mention of this kind of coloring in Microsoft documentations as well.

H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
Mohammadios
  • 45
  • 1
  • 4
  • See following : https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/ide/reference/fonts-and-colors-environment-options-dialog-box?view=vs-2015&redirectedfrom=MSDN – jdweng Dec 22 '20 at 18:29
  • 3
    You can't customize the color of arbitrary words. The highlighting matches the syntax highlighting for "Keywords" and the "User Types - *" items in Tools > Options > Fonts and Colors. It knows, for example, that `Window` is a type based on `` in the XML. It then examines the actual type, sees that it's a reference type, and uses the configured color. – madreflection Dec 22 '20 at 18:30
  • 6
    Just to add tot he previous comments, the true, false, null and other keywords are defined with tag too. For example, . See https://www.helixoft.com/blog/guidelines-to-better-xml-doc-comments-and-documentation.html – Peter Macej Dec 22 '20 at 20:46
  • thank you @madreflection and Peter Macej. i missed but the other one (langword) is not mentioned in Microsoft documentations somehow. if any of you want to take credit for the answer please do. – Mohammadios Dec 23 '20 at 14:35

1 Answers1

5

To get the blue color for true use this syntax inline: <see langword="true"/>

Noah Tomkins
  • 61
  • 1
  • 3