{"id":16226,"date":"2017-06-27T17:06:31","date_gmt":"2017-06-28T00:06:31","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=16226"},"modified":"2019-02-18T17:48:26","modified_gmt":"2019-02-18T17:48:26","slug":"visual-studio-code-cc-extension-june-2017-update","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/visual-studio-code-cc-extension-june-2017-update\/","title":{"rendered":"Visual Studio Code C\/C++ extension June 2017 Update"},"content":{"rendered":"<p>Today we are excited to announce the release of the June 2017 update of the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">C\/C++ extension for Visual Studio Code<\/a>. This update enables semantic-aware member list auto-completion and improves the overall default IntelliSense behavior, providing a smoother out-of-box IntelliSense experience.<\/p>\n<p>If you haven&#8217;t tried it before, download <a href=\"https:\/\/code.visualstudio.com\/\">VS Code (Stable build)<\/a> or <a href=\"https:\/\/code.visualstudio.com\/insiders\">VS Code Insiders<\/a>. Then download the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">C\/C++ extension for Visual Studio Code<\/a> to try it out. If you have this extension installed already, VS Code will notify you of the update and install it automatically.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Blogpost.png\"><img decoding=\"async\" width=\"642\" height=\"157\" class=\"alignnone wp-image-16265 size-full\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Blogpost.png\" \/><\/a><\/p>\n<p>The <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/cc-extension-for-visual-studio-code\/\">original blog post,<\/a> which\u00a0provides an overview of this extension,\u00a0has been updated with these changes.<\/p>\n<h2>Improved IntelliSense experience<\/h2>\n<p>In last month&#8217;s update, we enhanced the operation of our original tag parser IntelliSense engine that typically provides &#8220;fuzzy&#8221;\u009d results for editing features with a new, more powerful semantic engine. This new engine provides the capability to provide more productive language service features. As with the May update, the new engine is on by default only for <a href=\"https:\/\/code.visualstudio.com\/insiders\">VS Code Insiders<\/a>. However, everyone else is encouraged to try it out themselves by changing the &#8220;C_Cpp.intelliSenseEngine&#8221; setting in your <strong>settings.json<\/strong> file from &#8220;Tag Parser&#8221;\u009d to &#8220;Default&#8221;\u009d.<\/p>\n<p>After updating your includePath to find all headers, the new IntelliSense engine will be able to provide more accurate autocomplete suggestions for class\/struct\/namespace members, quick info tooltips, and error squiggles (linting). The new IntelliSense engine is used whenever possible as the default. In the cases when the engine returns errors, the extension dynamically falls back to use the tag parser for opened file. See section &#8220;How fallback works and how to control the behavior&#8221;\u009d below for more details.<\/p>\n<h3>Member List Autocomplete<\/h3>\n<p>Unlike the tag parser, the new semantic engine can determine type and therefore provide a more concise and accurate list of completion items when you type &#8220;.&#8221;, &#8220;-&gt;&#8221; or &#8220;::&#8221;.<\/p>\n<p>Please note that this functionality is not enabled at the global scope when typing &#8220;::&#8221; or when providing quick suggestions when no scoping character is provided. The tag parser continues to provide suggestions for both cases.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/225.png\"><img decoding=\"async\" width=\"738\" height=\"606\" class=\"alignnone wp-image-16236 size-full\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/225.png\" \/><\/a><\/p>\n<h3>IntelliSenseMode setting<\/h3>\n<p>In the May update, the semantic engine limited compiling code in &#8220;MSVC mode&#8221;\u009d on Windows and &#8220;Clang\/GCC mode&#8221;\u009d on Linux and Mac.\u00a0In this update, we added a setting that lets you choose which mode to compile your code in regardless of the platform on which you&#8217;re running.<\/p>\n<p>For example, if you are using MinGW on Windows, you can now instruct the IntelliSense engine to use &#8220;Clang\/GCC mode&#8221;\u009d instead of &#8220;MSVC mode&#8221;\u009d. The mode can be configured by modifying the &#8220;intelliSenseMode&#8221; property in the active config in your<strong> c_cpp_properties.json<\/strong> file.<\/p>\n<h2>How fallback works and how to control the behavior<\/h2>\n<p>The extension first tries to fully parse any opened file using the new IntelliSense engine. If it discovers that it cannot find a header file or a dependency, it will fall back to the tag parser and provide the original fuzzy IntelliSense behavior. The fallback affects a full translation unit (TU), not just a single open file. Other opened TUs will continue to use the new IntelliSense engine provided that all #include dependencies are resolved. This behavior effectively addresses the &#8220;sea of red squiggles&#8221;\u009d many users saw in the May update by only showing green squiggles for any #include statements that could not be resolved. The Problems panel provides details about unresolved headers and dependencies.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/315.png\"><img decoding=\"async\" width=\"738\" height=\"606\" class=\"alignnone wp-image-16245 size-full\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/315.png\" \/><\/a><\/p>\n<p>To support the new fallback experience discussed above and make it easier for users to discover and resolve includePath problems, the extension provides Code Actions next to #include statements that provide a shortcut to add new paths or disable the fallback mechanism. Putting the text cursor on such a squiggle and clicking the light bulb that appears will display these shortcuts.<\/p>\n<p>We recognize that resolving all #include&#8217;s may not be necessary for all projects and you may still want to experience the productivity benefits of using the new sematic engine without customizing the default include path. For that, the &#8220;Force semantic IntelliSense&#8221;\u009d action can be chosen. When invoked, all unresolved #include squiggles will turn red and semantic member list and linting will be enabled in all files regardless of whether or not #include statements can be resolved.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/413.png\"><img decoding=\"async\" width=\"738\" height=\"606\" class=\"alignnone wp-image-16255 size-full\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/413.png\" \/><\/a><\/p>\n<h2>Tell us what you think<\/h2>\n<p><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">Download the C\/C++ extension for Visual Studio Code<\/a>, try it out and let us know what you think. File <a href=\"https:\/\/github.com\/Microsoft\/vscode-cpptools\/issues\">issues and suggestions on GitHub<\/a>. If you haven&#8217;t already provided us feedback, please take this <a href=\"https:\/\/www.surveymonkey.com\/r\/X6ZSTP5\">quick survey<\/a> to help shape this extension for your needs.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we are excited to announce the release of the June 2017 update of the C\/C++ extension for Visual Studio Code. This update enables semantic-aware member list auto-completion and improves the overall default IntelliSense behavior, providing a smoother out-of-box IntelliSense experience. If you haven&#8217;t tried it before, download VS Code (Stable build) or VS Code [&hellip;]<\/p>\n","protected":false},"author":327,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,1,275],"tags":[274,276],"class_list":["post-16226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-cplusplus","category-visual-studio-code","tag-c-extension","tag-vscode"],"acf":[],"blog_post_summary":"<p>Today we are excited to announce the release of the June 2017 update of the C\/C++ extension for Visual Studio Code. This update enables semantic-aware member list auto-completion and improves the overall default IntelliSense behavior, providing a smoother out-of-box IntelliSense experience. If you haven&#8217;t tried it before, download VS Code (Stable build) or VS Code [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/16226","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\/327"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=16226"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/16226\/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=16226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=16226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=16226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}