{"id":17136,"date":"2017-10-20T15:08:12","date_gmt":"2017-10-20T22:08:12","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=17136"},"modified":"2019-02-18T17:48:16","modified_gmt":"2019-02-18T17:48:16","slug":"visual-studio-code-cc-extension-october-2017-update","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/visual-studio-code-cc-extension-october-2017-update\/","title":{"rendered":"Visual Studio Code C\/C++ extension October 2017 update"},"content":{"rendered":"<p><a href=\"https:\/\/blogs.msdn.microsoft.com\/c\/2017\/11\/02\/visual-studio-code-c-c-%E6%89%A9%E5%B1%952017%E5%B9%B410%E6%9C%88%E6%9B%B4%E6%96%B0\/\">\u70b9\u8fd9\u91cc\u770b\u4e2d\u6587\u7248<\/a><\/p>\n<p>Yesterday we shipped the October 2017 update of the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">Visual Studio Code C\/C++ extension<\/a>. Following the <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/visual-studio-code-cc-extension-september-2017-update-more-intellisense-goodness\/\">lightbulb suggestions for IntelliSense include path feature<\/a> that was shipped last month, we&#8217;re adding another feature to make IntelliSense setup easier &#8211; support for the compile_commands.json file, eliminating the need for manually configuring includes and defines. In addition, this update also introduces new UI to indicate IntelliSense parsing status.<\/p>\n<h2>Compile_commands.json to supply includes and defines information for IntelliSense<\/h2>\n<p>The compile_commands.json file is a compilation database that consists of an array of\u00a0 &#8220;command objects&#8221;\u009d, where each command object specifies one way a translation unit is compiled in the project. Its format is specified in the <a href=\"https:\/\/clang.llvm.org\/docs\/JSONCompilationDatabase.html\">Clang documentation<\/a> and can be auto-generated by many build systems, including CMake and Ninja. When the IntelliSense engine is set to &#8220;Default&#8221;\u009d, it will first read includes and defines from the compile_commands.json file to power IntelliSense if the file is specified in the &#8220;compileCommands&#8221;\u009d property in the c_cpp_properties.json file.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/124.png\"><img decoding=\"async\" width=\"879\" height=\"86\" class=\"alignnone size-large wp-image-17146\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/124-1024x100.png\" \/><\/a><\/p>\n<p>If parsing fails, the IntelliSense engine will then fall back to use the include paths from the &#8220;includePath&#8221;\u009d property and defines from the &#8220;defines&#8221;\u009d property in the c_cpp_properties.json file.<\/p>\n<h2>Try out the compiler-based IntelliSense<\/h2>\n<p>Note that the compile_commands.json file support is only available if you have turned on the new compiler-based engine. By doing so you will get improved, more accurate results for several IntelliSense features, including auto-complete suggestions for class\/struct\/namespace members, quick info tooltips, error squiggles, reference highlighting, and parameter hints. Turn on the new IntelliSense by changing the &#8220;C_Cpp.intelliSenseEngine&#8221;\u009d setting in your <em>settings.json <\/em>file (open from menu<em> File-&gt;Preferences-&gt;Settings<\/em>) from &#8220;Tag Parser&#8221;\u009d to &#8220;Default&#8221;\u009d.<\/p>\n<h2>IntelliSense status indicator<\/h2>\n<p>In the right corner of the status bar, you will find two icons indicating the parsing status of the IntelliSense engines &#8211; the red flame icon for the compiler-based IntelliSense engine and the white database icon to show where the Tag Parser is in parsing files. Hover over the database icon to see a tooltip that shows the number of files that are already parsed and the total number of files to be parsed.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/216.png\"><img decoding=\"async\" width=\"879\" height=\"141\" class=\"alignnone size-large wp-image-17156\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/216-1024x164.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>. Provide us feedback in this <a href=\"https:\/\/www.surveymonkey.com\/r\/X6ZSTP5\">quick survey<\/a> to help shape this extension for your needs. You can also find us on Twitter (<a href=\"https:\/\/twitter.com\/visualc\">@VisualC<\/a>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u70b9\u8fd9\u91cc\u770b\u4e2d\u6587\u7248 Yesterday we shipped the October 2017 update of the Visual Studio Code C\/C++ extension. Following the lightbulb suggestions for IntelliSense include path feature that was shipped last month, we&#8217;re adding another feature to make IntelliSense setup easier &#8211; support for the compile_commands.json file, eliminating the need for manually configuring includes and defines. In addition, [&hellip;]<\/p>\n","protected":false},"author":269,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,275],"tags":[274,276],"class_list":["post-17136","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-visual-studio-code","tag-c-extension","tag-vscode"],"acf":[],"blog_post_summary":"<p>\u70b9\u8fd9\u91cc\u770b\u4e2d\u6587\u7248 Yesterday we shipped the October 2017 update of the Visual Studio Code C\/C++ extension. Following the lightbulb suggestions for IntelliSense include path feature that was shipped last month, we&#8217;re adding another feature to make IntelliSense setup easier &#8211; support for the compile_commands.json file, eliminating the need for manually configuring includes and defines. In addition, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/17136","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\/269"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=17136"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/17136\/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=17136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=17136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=17136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}