{"id":22365,"date":"2019-01-24T10:01:57","date_gmt":"2019-01-24T18:01:57","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=22365"},"modified":"2019-04-09T22:18:14","modified_gmt":"2019-04-09T22:18:14","slug":"in-editor-code-analysis-in-visual-studio-2019-preview-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/in-editor-code-analysis-in-visual-studio-2019-preview-2\/","title":{"rendered":"In-editor code analysis in Visual Studio 2019 Preview 2"},"content":{"rendered":"<p>The C++ team has been working to refresh the Code Analysis experience inside Visual Studio. Last year, we <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2018\/06\/26\/new-experimental-code-analysis-features-in-visual-studio-2017-15-8-preview-3\/\">blogged about<\/a> some in-progress features in this area. We\u2019re happy to announce that in Visual Studio 2019 Preview 2, we\u2019ve integrated code analysis directly into the editor, improved upon previously experimental features, and enabled this as the default experience.<\/p>\n<h3>In-editor warnings &amp; background analysis<\/h3>\n<p>Code analysis now runs automatically in the background, and warnings display as green squiggles in-editor. Analysis re-runs every time you open a file in the editor and when you save your changes.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/InEditorCAWarnings1.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-22375\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/InEditorCAWarnings1.png\" alt=\"\" width=\"631\" height=\"176\" \/><\/a><\/p>\n<p>If you wish to disable \u2013 or re-enable \u2013 this feature, you can do so via the Tools &gt; Options &gt; Text Editor &gt; C++ &gt; Experimental &gt; Code Analysis menu, where you\u2019ll also be able to toggle squiggles displaying in-editor or the entire new C++ Code Analysis\/Error List experience.<\/p>\n<h3>Squiggle display improvements<\/h3>\n<p>We\u2019ve also made a few improvements to the display style of in-editor warnings. Squiggles are now only displayed underneath the code segment that is relevant to the warning. If we cannot find the appropriate code segment, we fall back to the Visual Studio 2017 behavior of showing the squiggle for the entire line.<\/p>\n<table width=\"640\">\n<tbody>\n<tr>\n<td width=\"320\">\n<p style=\"text-align: center\"><strong>Visual Studio 2017<\/strong><\/p>\n<\/td>\n<td width=\"320\">\n<p style=\"text-align: center\"><strong>Visual Studio 2019<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center\" width=\"320\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/VS2017_CA11.png\"><img decoding=\"async\" class=\"aligncenter wp-image-22385 size-mediumlarge\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/VS2017_CA11.png\" alt=\"\" width=\"500\" height=\"237\" \/><\/a><\/td>\n<td width=\"320\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/VS2019_CA11.png\"><img decoding=\"async\" class=\"aligncenter wp-image-22395 size-mediumlarge\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/VS2019_CA11.png\" alt=\"\" width=\"500\" height=\"244\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"319\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/VS2017_CA21.png\"><img decoding=\"async\" class=\"aligncenter wp-image-22405 size-mediumlarge\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/VS2017_CA21.png\" alt=\"\" width=\"500\" height=\"176\" \/><\/a><\/td>\n<td width=\"238\"><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/VS2019_CA21.png\"><img decoding=\"async\" class=\"aligncenter wp-image-22415 size-mediumlarge\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/VS2019_CA21.png\" alt=\"\" width=\"500\" height=\"187\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We\u2019ve also made performance improvements, especially for source files with many C++ code analysis warnings. Latency from when the file is analyzed until green squiggles appear has been greatly improved, and we\u2019ve also enhanced the overall UI performance during code analysis squiggle display.<\/p>\n<h3>Light bulb suggestions &amp; quick fixes<\/h3>\n<p>We\u2019ve begun adding light bulb suggestions to provide automatic fixes for warnings. Please see the <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/c-productivity-improvements-in-visual-studio-2019-preview-2\/\">C++ Productivity Improvements in Visual Studio 2019 Preview 2<\/a>\u00a0blog post for more information.<\/p>\n<h3>Send us feedback<\/h3>\n<p>Thank you to everyone who helps make Visual Studio a better experience for all. Your feedback is critical in ensuring we can deliver the best Code Analysis experience. We\u2019d love for you to download <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\">Visual Studio 2019 Preview 2<\/a>, give it a try, and let us know how it\u2019s working for you in the comments below or via email (<a href=\"mailto:visualcpp@microsoft.com\">visualcpp@microsoft.com<\/a>). If you encounter problems or have a suggestion, please let us know through Help &gt; Send Feedback &gt; Report A Problem \/ Provide a Suggestion or via <a href=\"https:\/\/developercommunity.visualstudio.com\/spaces\/62\/index.html\">Visual Studio Developer Community<\/a>. You can also find us on Twitter <a href=\"https:\/\/twitter.com\/visualc\">@VisualC<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The C++ team has been working to refresh the Code Analysis experience inside Visual Studio. Last year, we blogged about some in-progress features in this area. We\u2019re happy to announce that in Visual Studio 2019 Preview 2, we\u2019ve integrated code analysis directly into the editor, improved upon previously experimental features, and enabled this as the [&hellip;]<\/p>\n","protected":false},"author":1079,"featured_media":22754,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,230],"tags":[119],"class_list":["post-22365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-new-feature","tag-code-analysis"],"acf":[],"blog_post_summary":"<p>The C++ team has been working to refresh the Code Analysis experience inside Visual Studio. Last year, we blogged about some in-progress features in this area. We\u2019re happy to announce that in Visual Studio 2019 Preview 2, we\u2019ve integrated code analysis directly into the editor, improved upon previously experimental features, and enabled this as the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/22365","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\/1079"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=22365"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/22365\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/22754"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=22365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=22365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=22365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}