{"id":26274,"date":"2020-07-20T17:18:48","date_gmt":"2020-07-20T17:18:48","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=26274"},"modified":"2020-07-20T17:40:40","modified_gmt":"2020-07-20T17:40:40","slug":"visual-studio-code-c-extension-july-2020-update-doxygen-comments-and-logpoints","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/visual-studio-code-c-extension-july-2020-update-doxygen-comments-and-logpoints\/","title":{"rendered":"Visual Studio Code C++ Extension July 2020 Update: Doxygen comments and Logpoints"},"content":{"rendered":"<p>The July 2020 update of the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">Visual Studio Code C++ extension<\/a> is now available. This latest release offers brand new features, such as the visualization of Doxygen comments and support for Logpoints while debugging (GDB\/LLDB), along with a bunch of enhancements and bug fixes. To find out more about all the changes, check out our <a href=\"https:\/\/github.com\/microsoft\/vscode-cpptools\/releases\/tag\/0.29.0\">release notes on GitHub.<\/a><\/p>\n<h3>Displaying Doxygen Comments<\/h3>\n<p><a href=\"https:\/\/www.doxygen.nl\/index.html\">Doxygen<\/a> is a programming tool that generates documentation for source code. You can annotate your code with comments that contain helpful tips about functions, then Doxygen will generate documentation from these comments.<\/p>\n<p>With the July 2020 update, Visual Studio Code supports the visualization of Doxygen comments when hovering over a function and while typing.<\/p>\n<p>For example, if you have the following Doxygen comment above your <code>TriangleArea<\/code> function declaration:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-26276 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/doxygencomment.png\" alt=\"Image of Doxygen block comment above function\" width=\"954\" height=\"556\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/doxygencomment.png 954w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/doxygencomment-300x175.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/doxygencomment-768x448.png 768w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/p>\n<p>Then when you hover over <code>TriangleArea<\/code> in your code, you\u2019ll see the corresponding documentation:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-26278 size-full\" style=\"font-size: 1rem;\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/doxygenvisual.png\" alt=\"Visualization of Doxygen comment on hover\" width=\"996\" height=\"774\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/doxygenvisual.png 996w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/doxygenvisual-300x233.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/doxygenvisual-768x597.png 768w\" sizes=\"(max-width: 996px) 100vw, 996px\" \/><\/p>\n<p>You\u2019ll also see documentation while typing, such as when you\u2019re calling a function. If you call <code>TriangleArea<\/code>, for example, the following documentation will pop up with information about its parameters:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-26277 size-full\" style=\"font-size: 1rem;\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/doxygen-signature-help.gif\" alt=\"GIF of Doxygen visualization during signature help\" width=\"1308\" height=\"528\" \/><\/p>\n<h3>Logpoints<\/h3>\n<p>If you\u2019ve ever used print statements to debug your code, Logpoints will make your life a whole lot easier. Logpoints (also known as Tracepoints in Visual Studio) allow you to add on-demand logging statements into your application. When your program hits a Logpoint, it will print its contents to the debug console and continue running; it doesn\u2019t stop executing as it would for a breakpoint. Logpoints are like breakpoints, though, in the sense that they are not part of the source code. No clean up necessary!<\/p>\n<p>With the July 2020 update, the C++ extension now supports Logpoints for GDB and LLDB. To add a Logpoint, right click in the far-left margin next to a line of code. Then select <strong>Add Logpoint<\/strong> and type the message you want to log. Any expression between curly braces (\u2018{\u2018 and \u2018}\u2019) will be evaluated when the Logpoint hits.<\/p>\n<h3 style=\"font-family: Arimo, 'Helvetica Neue', Arial, sans-serif; color: #52595e;\"><img decoding=\"async\" class=\"alignnone size-full wp-image-26280\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/logpoint.gif\" alt=\"GIF of creating a logpoint in VS Code\" width=\"1620\" height=\"304\" \/><\/h3>\n<p>You can also print the following $TOKENS in Logpoint messages:<\/p>\n<p>$ADDRESS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Current instruction<\/p>\n<p>$CALLER\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Calling function name<\/p>\n<p>$CALLSTACK\u00a0\u00a0\u00a0\u00a0\u00a0 Call stack<\/p>\n<p>$FUNCTION\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Current function name<\/p>\n<p>$PNAME\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Process name<\/p>\n<p>$TID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thread ID<\/p>\n<p>$TNAME\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thread name<\/p>\n<p>$TICK\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Tick count (from Windows GetTickCount)<\/p>\n<h3>Additional enhancements<\/h3>\n<p>Another enhancement with the July 2020 update is if you use a member selection operator on a pointer type, the C++ extension now shows suggestions for corresponding members and automatically converts \u2018.\u2019 to \u2018-&gt;\u2019 (<a href=\"https:\/\/github.com\/microsoft\/vscode-cpptools\/issues\/862\">#862<\/a>).<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-26275 size-full\" style=\"font-size: 1rem;\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/07\/autoconvert_arrow.gif\" alt=\"GIF of member selector operator converting to an arrow when type is pointer\" width=\"1392\" height=\"532\" \/><\/p>\n<h3>What do you\u00a0think?<\/h3>\n<p><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">Download the C++ extension for Visual Studio Code<\/a> today, give it a try, and let us know what you think. If you run into any issues, or have any suggestions, please report them in the <a href=\"https:\/\/github.com\/Microsoft\/vscode-cpptools\/issues\">Issues section of our GitHub repository<\/a>. You can also join our Insiders program and get access to early builds of our release by going to <strong>File<\/strong> &gt; <strong>Preferences<\/strong> &gt; <strong>Settings<\/strong> and under <strong>Extensions<\/strong> &gt; <strong>C\/C++,<\/strong> change the \u201c<strong>C_Cpp: Update Channel<\/strong>\u201d to \u201c<strong>Insiders<\/strong>\u201d.<\/p>\n<p>We can be reached via the comments below or in email at <a href=\"mailto:visualcpp@microsoft.com\">visualcpp@microsoft.com<\/a>. You can also find our team on Twitter at <a href=\"https:\/\/twitter.com\/visualc\">@<\/a><a href=\"https:\/\/twitter.com\/visualc\">VisualC<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The July 2020 update of the Visual Studio Code C++ extension is now available. This latest release offers brand new features, such as the visualization of Doxygen comments and support for Logpoints while debugging (GDB\/LLDB), along with a bunch of enhancements and bug fixes. To find out more about all the changes, check out our [&hellip;]<\/p>\n","protected":false},"author":27203,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[140,55,276],"class_list":["post-26274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-c","tag-debugging","tag-vscode"],"acf":[],"blog_post_summary":"<p>The July 2020 update of the Visual Studio Code C++ extension is now available. This latest release offers brand new features, such as the visualization of Doxygen comments and support for Logpoints while debugging (GDB\/LLDB), along with a bunch of enhancements and bug fixes. To find out more about all the changes, check out our [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/26274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/27203"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=26274"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/26274\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=26274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=26274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=26274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}