{"id":21815,"date":"2018-12-05T11:27:11","date_gmt":"2018-12-05T19:27:11","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=21815"},"modified":"2019-02-18T17:47:32","modified_gmt":"2019-02-18T17:47:32","slug":"cppintellicode","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/cppintellicode\/","title":{"rendered":"AI-Assisted Code Completion Suggestions Come to C++ via IntelliCode"},"content":{"rendered":"<p><span>After reading and writing enough code, you <\/span><span>begin to notice<\/span><span> certain usage patterns. For example, if a stream is open, it will eventually be closed. More interestingly,<\/span><span> if a string is used in the context of an if-statement, it will often be to check if the string is empty or if it has a certain size. You begin to identify and use these coding patterns over time, but what if Visual Studio already knew these common patterns and could suggest them to you as you code? That\u2019s exactly what <\/span><span>IntelliCode<\/span><span> does.<\/span><span>\u00a0<\/span><\/p>\n<p><span>IntelliCode<\/span><span> uses machine learning to train over <\/span><span>thousands of real-world projects including open-source projects on GitHub<\/span><span>.\u00a0As such, IntelliCode will be most helpful when using common libraries such as STL. Based on this training, <\/span><span>IntelliCode<\/span><span> saves your time by putting what you\u2019re most likely to use at the top of your IntelliSense completion list.\u00a0<\/span><span>IntelliCode<\/span> <span>for C++<\/span><span> is now <\/span><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=VisualStudioExptTeam.VSIntelliCode\"><span>available as an extension<\/span><\/a><span> for <\/span><span>Visual Studio 2019<\/span><span>.<\/span><span>\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/intelliblog1.png\"><img decoding=\"async\" width=\"872\" height=\"321\" class=\"alignnone size-full wp-image-21825\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/intelliblog1.png\" \/><\/a><\/p>\n<p><span>As you use the <\/span><span>IntelliCode<\/span><span> extension, you will start to <\/span><span>notice <\/span><span>starred items at the top of your Member List \u2013 those are<\/span> <span>IntelliCode<\/span><span> recommendations<\/span><span>. For example, <\/span><span>below <\/span><span>we see \u201c<\/span><span>cend<\/span><span>\u201d being recommended based on the <\/span><span>context <\/span><span>of using \u201c<\/span><span>cbegin<\/span><span>\u201d.<\/span><span> This is important since mixing \u201c<\/span><span>cbegin<\/span><span>\u201d with plain \u201cend\u201d is a compiler error with STL algorithms.<\/span><span>\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/intellicode1.gif\"><img decoding=\"async\" width=\"807\" height=\"335\" class=\"alignnone size-full wp-image-21835\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/intellicode1.gif\" \/><\/a><\/p>\n<h3><span>What\u2019s Next<\/span><span>\u00a0<\/span><\/h3>\n<p><span>In a future release we will give C++ developers the ability to let <\/span><span>IntelliCode<\/span> <a href=\"https:\/\/aka.ms\/vsicblog\"><span>learn from your own code<\/span><\/a><span>. We are also considering adding C++ <\/span><span>IntelliCode<\/span><span> support to Visual Studio Code.<\/span><span>\u00a0<\/span><\/p>\n<h3><span>Give Us Your Feedback\u202f<\/span><span>\u00a0<\/span><\/h3>\n<p><span>IntelliCode<\/span><span> is new for C++ developers using Visual Studio, so we are eager to hear your feedback as we continue to improve your experience. We can be reached via the comments below or via email at <\/span><span>visualcpp@microsoft.com<\/span><span>.\u202fIf you encounter problems with <\/span><span>IntelliCode<\/span><span> for C++ or have a suggestion for Visual Studio please let us know through\u202f<\/span><span>the Send Feedback button in the top right corner of Visual Studio<\/span><span>, or\u202fvia\u202f<\/span><a href=\"https:\/\/developercommunity.visualstudio.com\/topics\/C%2B%2B.html\"><span>Developer Community<\/span><\/a><span>.\u202fYou can also find us on Twitter <\/span><a href=\"https:\/\/twitter.com\/visualc\"><span>@VisualC<\/span><\/a><span>.<\/span><span>\u00a0<\/span><\/p>\n<p><span>\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After reading and writing enough code, you begin to notice certain usage patterns. For example, if a stream is open, it will eventually be closed. More interestingly, if a string is used in the context of an if-statement, it will often be to check if the string is empty or if it has a certain [&hellip;]<\/p>\n","protected":false},"author":329,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,230],"tags":[],"class_list":["post-21815","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-new-feature"],"acf":[],"blog_post_summary":"<p>After reading and writing enough code, you begin to notice certain usage patterns. For example, if a stream is open, it will eventually be closed. More interestingly, if a string is used in the context of an if-statement, it will often be to check if the string is empty or if it has a certain [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/21815","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\/329"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=21815"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/21815\/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=21815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=21815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=21815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}