March 26th, 2020
heart1 reaction

Doxygen and XML Doc Comment support

Whether you’re using Doxygen or XML Doc Comments, Visual Studio version 16.6 Preview 2 provides automatic comment stub generation as well as Quick Info, Parameter Help, and Member List tooltip support.

Stub Generation

By default, the stub generation is set to XML Doc Comments. The comment stub can be generated by typing a triple slash (///) or by using the documentation generation shortcut (Ctrl+/) above the function.

XML Doc Comment
Image quadraticXMLgen
Doxygen

To switch to Doxygen, type “Doxygen” in the Ctrl+Q search box, or go to Tools > Options > Text Editor > C/C++ > > General, and choose your preferred documentation style:

Image documentationOptions

Once specified, you can generate the comment stub by typing the respective “///” or “/**” above a function, or by using the (Ctrl+/) shortcut.

You can also specify this documentation option on a per-folder or per-file basis via .editorconfig files with the corresponding setting:

vc_generate_documentation_comments = none
vc_generate_documentation_comments = xml
vc_generate_documentation_comments = doxygen_triple_slash
vc_generate_documentation_comments = doxygen_slash_star

To get started, you can have Visual Studio generate an .editorconfig file for you based on your existing setting for documentation by using the “Generate .editorconfig file from settings” button shown in the screenshot above.

Image QuadraticDoxygen

Tooltip Display

Documentation artifacts will now appear in Quick Info, Member List, and Parameter Help tooltips:

Image tooltips

 

Give us your feedback

Download Visual Studio 2019 version 16.6 Preview 2 today and give this new documentation support a try. We can be reached via the comments below, email (visualcpp@microsoft.com), and Twitter (@VisualC). The best way to file a bug or suggest a feature is via Developer Community.

Category

Author

Nick Uhlenhuth is a Program Manager on the Visual Studio team responsible for C++ IntelliSense and Productivity features.

12 comments

Discussion is closed. Login to edit/delete existing comments.

Sort by :
  • Steve Valliere

    Two suggestions/requests:
    1. This may already exist and I haven't figured it out, but it would be great if we could include links to our in-house documentation instead of (or in addition to) the existing "Search online" link that is already included in the tool tip. We have all of our in-house libraries documented in a wiki and we would love to be able to get to it [almost] directly!
    2. This one is kinda pie-in-the-sky, but it doesn't hurt to ask, right? (smile) I think it would be awesome if the documentation files could...

    Read more
  • Charles Savoie

    This is a welcome addition, but unfortunately the tooltip display omits important information such as \throw and \remark, making it less useful than simply showing the raw comment accompanying the header declaration. It would also be nice if referencing via \see were supported; for example, if the entire description consists of a single \see directive, the documentation for the referenced symbol should be shown.

  • Александр Бочагов

    It’s a great news about support doxygen style comments.

    Here is some questions about plans.
    Would you plan to support:
    1. special formatting features like LIST’s in parameter description?
    2. documenting the structure/class members?
    3. use special commands like \class, \struct, \enum and so on?
    4. internal references through \see command?

    Thanks.

  • Mike Walter

    This only works if I put the xml comments in the header file and not in the cpp file. Your example above implies it works when adding the xml comments to the cpp. Which is correct?

    Thanks,