{"id":22515,"date":"2019-01-24T10:01:48","date_gmt":"2019-01-24T18:01:48","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=22515"},"modified":"2019-02-18T17:47:27","modified_gmt":"2019-02-18T17:47:27","slug":"template-intellisense-improvements-for-visual-studio-2019-preview-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/template-intellisense-improvements-for-visual-studio-2019-preview-2\/","title":{"rendered":"Template IntelliSense Improvements for Visual Studio 2019 Preview 2"},"content":{"rendered":"<p>In the <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/template-intellisense\/\">first version of Template IntelliSense<\/a>, we introduced the Template Bar which allowed you to provide sample arguments for your template in order to get a richer IntelliSense experience within the template body. Since then, we\u2019ve received a lot of great feedback and suggestions which have led to significant improvements. Our latest iteration includes the following:<\/p>\n<ul>\n<li>Peek Window UI<\/li>\n<li>Live Edits<\/li>\n<li>Nested Template support<\/li>\n<li>Default Argument watermarks<\/li>\n<\/ul>\n<h2>Peek Window UI and Live Edits<\/h2>\n<p>Clicking the edit button on the Template Bar no longer brings up a modal dialog instead, it opens a Peek Window. The benefit of the Peek Window UI is that it integrates more smoothly into your workflow and allows you to perform live edits. As you type your sample template arguments, the IntelliSense in the template body will update in real-time to reflect your changes. This lets you quickly see how various arguments may affect your code. In the example below, we see that we get Member List completion for <em>std::string<\/em>, but we get a red squiggle when we change the sample argument to <em>double<\/em>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/TIv2Peek1.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-22525\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/TIv2Peek1.gif\" width=\"963\" height=\"411\" \/><\/a><\/p>\n<h2>Nested Template Support and Default Argument Watermarks<\/h2>\n<p>We\u2019ve also improved our Template Bar support for nested templates. Previously, the Template Bar would only appear at the top-level parent. Now, the it appears at the template header of the inner-most template to the cursor. Note that even from within the member function template you will be able to modify the sample argument of the containing class template:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/nested1.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-22535\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2019\/01\/nested1.png\" width=\"723\" height=\"610\" \/><\/a><\/p>\n<p>You\u2019ll also notice that we auto-populate the Peek Window textbox with a watermark if there is a default argument (as in the case of V above). Keeping that textbox as-is will use the default value for IntelliSense; otherwise, you can specify a different sample argument.<\/p>\n<h2>Other Productivity Features in Preview 2<\/h2>\n<p><a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2019\/01\/24\/c-productivity-improvements-in-visual-studio-2019-preview-2\">C++ Productivity Improvements in Visual Studio 2019 Preview 2<\/a><\/p>\n<h2>Talk to Us!<\/h2>\n<p>We\u2019d love for you to <u>download Visual Studio<\/u> and give Template IntelliSense \u00a0a try. As always, we welcome your feedback. We can be reached via the comments below or via email (<u>visualcpp@microsoft.com<\/u>). If you encounter other problems with MSVC or have a suggestion for Visual Studio please let us know through <u>Help &gt; Send Feedback &gt; Report A Problem \/ Provide a Suggestion in the IDE<\/u>, or via <u>Developer Community<\/u>. You can also find us on Twitter (<u>@VisualC<\/u>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the first version of Template IntelliSense, we introduced the Template Bar which allowed you to provide sample arguments for your template in order to get a richer IntelliSense experience within the template body. Since then, we\u2019ve received a lot of great feedback and suggestions which have led to significant improvements. Our latest iteration includes [&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],"tags":[],"class_list":["post-22515","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement"],"acf":[],"blog_post_summary":"<p>In the first version of Template IntelliSense, we introduced the Template Bar which allowed you to provide sample arguments for your template in order to get a richer IntelliSense experience within the template body. Since then, we\u2019ve received a lot of great feedback and suggestions which have led to significant improvements. Our latest iteration includes [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/22515","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=22515"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/22515\/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=22515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=22515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=22515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}