{"id":19565,"date":"2018-06-21T22:11:36","date_gmt":"2018-06-22T05:11:36","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=19565"},"modified":"2019-02-18T17:47:53","modified_gmt":"2019-02-18T17:47:53","slug":"visual-studio-code-cc-extension-june-2018-update","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/visual-studio-code-cc-extension-june-2018-update\/","title":{"rendered":"Visual Studio Code C\/C++ extension June 2018 Update"},"content":{"rendered":"<h2>Visual Studio Code C\/C++ extension June 2018 Update<\/h2>\n<p>Today we\u2019re very happy to announce the availability of the June 2018 update to the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">C\/C++ extension for Visual Studio Code<\/a>! In this update, we are continuing our efforts to make IntelliSense configuration easier by auto-detecting <em>compile_commands.json<\/em> files for IntelliSense, significantly improving recursive search performance, making browse.path optional, and adding \u201ccompilerPath\u201d support for MSVC.<\/p>\n<h3>IntelliSense auto-detects compile_commands.json<\/h3>\n<p>In this update,<em> compile_commands.json<\/em> files in the workspace will be detected to auto-configure IntelliSense, eliminating the need to manually specify includes and defines.<\/p>\n<p><em>Compile_commands.json<\/em> file is a compilation database that consists of an array of\u00a0\u201ccommand objects\u201d, 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 it can be generated by many build systems, such as CMake. The C\/C++ extension added support for it in the <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2017\/10\/20\/visual-studio-code-cc-extension-october-2017-update\/\">October 2017 update<\/a>, but it was an optional setting that required manually setting the path to the file. This latest update added auto-detection to make use of such files. If multiple files are found, you will be presented with a dropdown to choose the appropriate one. The following screenshot shows an example of the message suggesting the use of a <em>compile_commands.json<\/em> file to auto-configure IntelliSense and the dropdown with two choices.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/19.png\"><img decoding=\"async\" width=\"471\" height=\"121\" class=\"alignnone size-full wp-image-19575\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/19.png\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/23.png\"><img decoding=\"async\" width=\"624\" height=\"110\" class=\"alignnone size-large wp-image-19585\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/23.png\" \/><\/a><\/p>\n<p>Once selected, IntelliSense will be fully powered by using the information in that file with no further configuration required. If you need to change the path, you can find the \u201ccompileCommands\u201d setting in the <em>c_cpp_properties.json<\/em> file (access via Command Palette -&gt; C\/Cpp: Edit Configurations\u2026).<\/p>\n<h3>Performance improvement for IntelliSense path recursive search<\/h3>\n<p>Support for recursive search of \u201cincludePath\u201d was added in the <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2018\/05\/08\/visual-studio-code-cc-extension-may-2018-update-intellisense-configuration-just-got-so-much-easier\/\">May 2018 update<\/a><u>.<\/u> This latest update significantly improves the search performance on large folders. By intelligently cutting down the number of paths that need to be processed by the IntelliSense engine, we were able to make search faster \u2013 in particular, subsequent folder opening is orders of magnitude faster. Due to these improvements, recursive search is now the default behavior for newly-opened folders. To opt out, simply remove \u201c**\u201d from each path in the <em>c_cpp_properties.json<\/em> file.<\/p>\n<h3>Browse.path is now optional<\/h3>\n<p>For the longest time, we had two path settings: \u201cincludePath\u201d for the IntelliSense engine, and \u201cbrowse.path\u201d for the Tag Parser. The <a href=\"https:\/\/github.com\/Microsoft\/vscode-cpptools\/blob\/master\/Documentation\/LanguageServer\/IntelliSense%20engine.md\">IntelliSense engines<\/a> document explains the difference between the two. While it could be useful at times to have different sets of paths, in many cases they end up being duplicated. In this update, we\u2019re making \u201cbrowse.path\u201d optional, which means it won\u2019t be populated in newly-created <em>c_cpp_properties.json<\/em> files. The \u201cincludePath\u201d values will be used for the Tag Parser in addition to the IntelliSense engine, if \u201cbrowse.path\u201d is not present.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/33.png\"><img decoding=\"async\" width=\"500\" height=\"296\" class=\"alignnone wp-image-19595 size-mediumlarge\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/33-500x296.png\" \/><\/a><\/p>\n<h3>compilerPath setting added support for MSVC (Microsoft Visual C++ Compiler)<\/h3>\n<p>\u201ccompilerPath\u201d is a setting introduced previously that allows users to specify a compiler from which IntelliSense can retrieve system includes and defines. This update added support for MSVC \u2013 this means the \u201ccompilerPath\u201d setting in the default Windows configuration will use the latest MSVC installed on the machine for includes\u00a0 and its value can be changed to a different version if needed.<\/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\u2019t already provided us feedback, please take this <a href=\"https:\/\/www.research.net\/r\/VBVV6C6\">quick survey<\/a> to help shape this extension for your needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual Studio Code C\/C++ extension June 2018 Update Today we\u2019re very happy to announce the availability of the June 2018 update to the C\/C++ extension for Visual Studio Code! In this update, we are continuing our efforts to make IntelliSense configuration easier by auto-detecting compile_commands.json files for IntelliSense, significantly improving recursive search performance, making browse.path [&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-19565","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>Visual Studio Code C\/C++ extension June 2018 Update Today we\u2019re very happy to announce the availability of the June 2018 update to the C\/C++ extension for Visual Studio Code! In this update, we are continuing our efforts to make IntelliSense configuration easier by auto-detecting compile_commands.json files for IntelliSense, significantly improving recursive search performance, making browse.path [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/19565","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=19565"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/19565\/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=19565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=19565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=19565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}