Pretty Doc CommentsA Visual Studio extension that overlays XML doc comments with a rendered image. It makes the comment much more readable and reduces visual noise created by XML-tags. CompatibilityIt works with single line comments in C#, C++, F# (
Getting StartedDownload and run the extension (VSIX) for Visual Studio 2022 or later from the Visual Studio Marketplace or, from within Visual Studio, search for "PrettyDocComments" in the "Extensions and Updates" UI. Editing XML doc commentsWhen the text cursor (or the text selection start or end) is on a doc comment line, the pretty image is hidden, and the original XML text is revealed and ready to be edited the usual way. The XML must be valid XML! If it is not, the original comment text and an error message are displayed. For example, a '<' character must be written as < and the ampersand character (&) must be written as & Note that Visual Studio cannot display tooltips from comments containing invalid XML. ConfigurationYou can configure the appearance of the prettified comments in menu Tools / Options..., section Pretty Doc Comments Collapse to SummaryYou can collapse the comments so that text following the <summary> tag will be hidden. This is a global setting affecting all the comments. Expanded (default): Collapsed: A greater than sign (>) appears to the lower right of the comment if text was hidden. You can change this setting in three ways:
Comment Width OptionsThree settings control the width of the prettified comments:
AdvancedCompensate Line Height Rounding (experimental)This option is enabled by default. It compensates for the rounding of the line height by Visual Studio. Explanation: this extension expands or shrinks the line heights of the doc comments underneath the prettified comments to make them fit the prettified comment height. However, Visual Studio rounds the line heights using an unknown algorithm, which can lead to a slight truncation of the comments. This option compensates for this rounding by using a heuristic. In a first render pass, the deviation from the estimated height is measured and in a second pass the line heights are adjusted to compensate for this deviation. This can lead to a slight movement of the comment heights. If this bothers you, you can disable this option. Shink Empty Lines extensionIf you have also installed and enabled the Shrink Empty Lines extensions from the Microsoft Productivity Power Tools, it might interfere with this extension as both are changing the line heights. This can be avoided by disabling
Tools -> Options -> Productivity Power Tools -> General -> Compress lines that do not have any alphanumeric characters. You can leave the other option Compress blank lines enabled. |