{"id":8906,"date":"2016-06-01T13:18:09","date_gmt":"2016-06-01T20:18:09","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=8906"},"modified":"2019-02-18T18:04:48","modified_gmt":"2019-02-18T18:04:48","slug":"may-update-for-the-cc-extension-in-visual-studio-code","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/may-update-for-the-cc-extension-in-visual-studio-code\/","title":{"rendered":"May\/June update for the C\/C++ extension in Visual Studio Code"},"content":{"rendered":"<p style=\"text-align: left\">We would like to thank all of you who have tried out the <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/cc-extension-for-visual-studio-code\/\">C\/C++ extension in Visual Studio Code <\/a>and have already provided\nrich feedback on your experiences and <a href=\"https:\/\/github.com\/Microsoft\/vscppsamples\/issues\">filed issues and requests with us<\/a>. We are working hard on incorporating your feedback\ninto the product. Continuing with our effort to make Visual Studio Code as the editor tool of choice for C++ developers with\nthis update of the C\/C++ extension, we are introducing the following features:<\/p>\n<p style=\"text-align: left\">\u2022 Code formatting with clang-format\n\u2022 Fuzzy Auto-Complete for C\/C++ code\n\u2022 Debugging on Windows for Cygwin\/MinGW applications\n\u2022 Console application debugging with GDB on the Mac\n\u2022 Toggle between Header\/Source File (F4)<\/p>\n<p style=\"text-align: left\">Now let\u2019s dive into each one of these in more detail.<\/p>\n<h4 style=\"text-align: left\">Code formatting with clang-format<\/h4>\n<p style=\"text-align: left\">You can now format your C\/C++ code with clang-format from inside Visual Studio Code. Currently <a href=\"http:\/\/llvm.org\/releases\/download.html\">clang-format<\/a> needs to be\ninstalled manually and the path for clang-format needs to be added to user settings in Visual Studio Code as shown in the figure below.<\/p>\n<p style=\"text-align: left\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/formating.gif\"><img decoding=\"async\" class=\"alignnone wp-image-8916\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/formating.gif\" alt=\"formating\" width=\"769\" height=\"409\" \/><\/a><\/p>\n<p style=\"text-align: left\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/usersettings.gif\"><img decoding=\"async\" class=\"alignnone wp-image-8945\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/usersettings.gif\" alt=\"usersettings\" width=\"770\" height=\"409\" \/><\/a>\nBy default, the clang-format style is set to \u2018file\u2019 which means it looks for a pre-existing. clang-format file, if the. clang-format file is found it\napplies formatting settings specified in the file. If the. clang-format file is not found the default fallback-style specified in the c_cpp_properties.json file is used. The default fall back style is set to \u2018LLVM\u2019 today.<\/p>\n<p style=\"text-align: left\">This clang-format behavior is controlled via the settings file \u2018c_cpp_properties.json\u2019 file which can be loaded and edited by executing the following command from the command palette.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/editconfig.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-8955\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/editconfig.gif\" alt=\"editconfig\" width=\"1500\" height=\"797\" \/><\/a><\/p>\n<h4 style=\"text-align: left\">Fuzzy Auto-Complete for C\/C++ code<\/h4>\n<p>This update of the C\/C++ extension in Visual Studio Code also introduces a preview version of a fuzzy Auto-Complete for C\/C++ code. It\u2019s based on an enhanced tag-parser approach, in other words no semantic analysis, so while it is not quite accurate it will still provide you more than what single-file intellisense provides you today. Additionally, this fuzzy intellisense approach will work pretty well for straight up C code so try it out and let us know what you think!<\/p>\n<p style=\"text-align: left\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/intellij.gif\"><img decoding=\"async\" class=\"alignnone wp-image-8975\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/intellij.gif\" alt=\"intellij\" width=\"781\" height=\"415\" \/><\/a><\/p>\n<h4 style=\"text-align: left\">Debugging on Windows for Cygwin\/MinGW applications<\/h4>\n<p>Another feature \u00a0we are adding as a part of this update is the ability for developers to be able to debug their C\/C++ Cygwin\/MinGW applications using Visual Studio Code. Users can choose to attach to or launch the application to debug directly. In order to use cygwin or MinGW, the debugger path must be set manually in the launch configuration (launch.json). This is done via the \u2018miDebuggerPath\u2019 property, as the following figure shows:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/vscode-debug.gif\"><img decoding=\"async\" class=\"alignnone wp-image-9115\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/vscode-debug.gif\" alt=\"vscode-debug\" width=\"798\" height=\"424\" \/><\/a><\/p>\n<h4 style=\"text-align: left\">Console application debugging with GDB on the Mac<\/h4>\n<p>In our previous release, we did not have the capability to debug console applications on the Mac using GDB. This has been added to this release. There are some known issues still, due to limitations with GDB. Please see the <a href=\"https:\/\/microsoft-my.sharepoint.com\/personal\/aasthan_microsoft_com\/_layouts\/15\/guestaccess.aspx?guestaccesstoken=8qRW6iRgJJUfvX5MSubuDVqYl2fPJM5mu6ZPox490%2fA%3d&amp;docid=2_10d02c8cb4711444b9de2cba2459ecc92&amp;rev=1\">readme for more information<\/a>.<\/p>\n<h4 style=\"text-align: left\">Toggle between Header\/Source file<\/h4>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/SwitchHeader.png\"><img decoding=\"async\" class=\"alignnone  wp-image-9515\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/SwitchHeader.png\" alt=\"SwitchHeader\" width=\"658\" height=\"89\" \/><\/a>Easily switch between header (F4) and source using the new C\/Cpp task added as a part of the extension.<\/p>\n<h4 style=\"text-align: left\">Update your extension now!<\/h4>\n<p>If you are already using the C\/C++ extension, you can update your extension easily by using the ext update dropdown. This will display any available updates for your currently installed extensions. To install the update, simply click the Update Extension button in the lower right for the outdated extension. You\u2019ll be prompted to restart VS Code.<\/p>\n<p style=\"text-align: left\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/updates.png\"><img decoding=\"async\" class=\"alignnone wp-image-9075\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/updates.png\" alt=\"updates\" width=\"701\" height=\"105\" \/><\/a><\/p>\n<p style=\"text-align: left\">Please refer to the original blog post for links to documentation and for more information about the overall experience of Visual Studio Code C\/C++. Please help us by continuing to file issues at our <a href=\"https:\/\/github.com\/Microsoft\/vscppsamples\/issues\">Github page<\/a> and keep trying out this experience and if you would like to shape the future of this extension please join our Cross-Platform C++ Insiders group, where you can speak with us directly and help make this product the best for your needs.<b>\u00a0<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We would like to thank all of you who have tried out the C\/C++ extension in Visual Studio Code and have already provided rich feedback on your experiences and filed issues and requests with us. We are working hard on incorporating your feedback into the product. Continuing with our effort to make Visual Studio Code [&hellip;]<\/p>\n","protected":false},"author":265,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8906","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus"],"acf":[],"blog_post_summary":"<p>We would like to thank all of you who have tried out the C\/C++ extension in Visual Studio Code and have already provided rich feedback on your experiences and filed issues and requests with us. We are working hard on incorporating your feedback into the product. Continuing with our effort to make Visual Studio Code [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/8906","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\/265"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=8906"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/8906\/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=8906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=8906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=8906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}