{"id":135,"date":"2022-10-17T11:17:11","date_gmt":"2022-10-17T10:17:11","guid":{"rendered":"https:\/\/mrzebra.co.uk\/code\/?p=135"},"modified":"2022-10-17T11:17:11","modified_gmt":"2022-10-17T10:17:11","slug":"how-to-show-doxygen-errors-in-vscodes-problems-panel","status":"publish","type":"post","link":"https:\/\/zebra-north.com\/code\/2022\/10\/17\/how-to-show-doxygen-errors-in-vscodes-problems-panel\/","title":{"rendered":"How to show Doxygen errors in VSCode&#8217;s &#8220;Problems&#8221; panel"},"content":{"rendered":"\n<p>If you&#8217;re using Doxygen to generate your project&#8217;s documentation, it would be nice to see errors in Visual Studio Code&#8217;s &#8220;Problems&#8221; panel so you can assess them and jump directly to them in the source code.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"83\" src=\"https:\/\/zebra-north.com\/code\/wp-content\/uploads\/2022\/10\/test.png\" alt=\"\" class=\"wp-image-136\" srcset=\"https:\/\/zebra-north.com\/code\/wp-content\/uploads\/2022\/10\/test.png 495w, https:\/\/zebra-north.com\/code\/wp-content\/uploads\/2022\/10\/test-300x50.png 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/figure><\/div>\n\n\n<!--more-->\n\n\n\n<p>This can be achieved by creating a build task to run Doxygen, and a custom problem matcher to gather the errors.<\/p>\n\n\n\n<p>Add a new task to VSCode&#8217;s <code>tasks.json<\/code> file.  If the file does not exist, create it in the &#8220;.vscode&#8221; directory.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-json\">{\n\t&quot;version&quot;: &quot;2.0.0&quot;,\n\t&quot;tasks&quot;: [\n\t\t{\n\t\t\t&quot;type&quot;: &quot;process&quot;,\n\t\t\t&quot;label&quot;: &quot;Build documentation&quot;,\n\t\t\t&quot;command&quot;: &quot;doxygen&quot;,\n\t\t\t&quot;group&quot;: &quot;build&quot;,\n\t\t\t&quot;problemMatcher&quot;: [\n\t\t\t\t{\n\t\t\t\t\t&quot;owner&quot;: &quot;cpp&quot;,\n\t\t\t\t\t&quot;fileLocation&quot;: &quot;absolute&quot;,\n\t\t\t\t\t&quot;pattern&quot;: {\n\t\t\t\t\t\t&quot;regexp&quot;: &quot;^([^:]+):(\\\\d+): (error|warning): (.*?)( \\\\(warning treated as error, aborting now\\\\))?$&quot;,\n\t\t\t\t\t\t&quot;file&quot;: 1,\n\t\t\t\t\t\t&quot;line&quot;: 2,\n\t\t\t\t\t\t&quot;severity&quot;: 3,\n\t\t\t\t\t\t&quot;message&quot;: 4\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t&quot;detail&quot;: &quot;Build documentation&quot;\n\t\t}\n    ]\n}<\/code><\/pre>\n\n\n\n<p>You can run the task from the toolbar by selecting &#8220;Tasks: Run Task&#8221; and choosing &#8220;Build documentation&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re using Doxygen to generate your project&#8217;s documentation, it would be nice to see errors in Visual Studio Code&#8217;s &#8220;Problems&#8221; panel so you can assess them and jump directly to them in the source code.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[17],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-cpp","tag-vscode"],"_links":{"self":[{"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/comments?post=135"}],"version-history":[{"count":1,"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"predecessor-version":[{"id":137,"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/posts\/135\/revisions\/137"}],"wp:attachment":[{"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zebra-north.com\/code\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}