{"id":6185,"date":"2016-07-13T12:12:41","date_gmt":"2016-07-13T19:12:41","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/dotnet\/?p=6185"},"modified":"2021-09-30T11:57:55","modified_gmt":"2021-09-30T18:57:55","slug":"visual-studio-15-preview-3-for-c-and-visual-basic","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/visual-studio-15-preview-3-for-c-and-visual-basic\/","title":{"rendered":"Visual Studio \u201815\u2019 Preview 3 for C# and Visual Basic"},"content":{"rendered":"<p>One of our major focuses in Visual Studio \u201815&#8242; is improving developer productivity inside the editor. As we develop, we all perform series of actions over and over again&#8211;like writing methods, renaming variables, changing method signatures, implementing interfaces, etc. Our goal is to help automate or reduce these tasks to a single click so that you can focus on logic rather than syntax, references, style, and formatting. You may have noticed each Visual Studio \u201815\u2019 release enhances existing experiences to save you a little more time and effort and\u00a0enables you to build faster with additional refactorings and code generation.<\/p>\n<p><a href=\"https:\/\/go.microsoft.com\/fwlink\/?LinkId=746567\">Download Visual Studio &#8217;15&#8217; Preview 3<\/a> and read the <a href=\"https:\/\/www.visualstudio.com\/en-us\/news\/releasenotes\/vs15-relnotes\">release notes<\/a> for more information about what is in this release. Please check out the\u00a0<a href=\"https:\/\/blogs.msdn.microsoft.com\/visualstudio\/2016\/07\/07\/visual-studio-15-preview-3\/\">Visual Studio &#8220;15&#8221; Preview 3 blog post<\/a>, too.<\/p>\n<h2><a id=\"user-content-unlock-the-potential-of-c70\" class=\"anchor\" href=\"#unlock-the-potential-of-c70\"><\/a>C# 7<\/h2>\n<p>One of the biggest productivity gains coming in Visual Studio \u201915\u2019 is from the C# language itself, with C# 7 features now \u201con\u201d by default:<\/p>\n<ul>\n<li><strong>Tuples<\/strong> allow groups of values to be easily passed around. This is especially helpful when you want to return multiple values from a method without using <code>out<\/code> parameters. C# 7 tuples may be used as keys in a Dictionary, for example, making it really easy to combine multiple values into a single key (<em>note<\/em>: the C# 7 compiler generates efficient <code>Equals<\/code> and <code>GetHashCode<\/code> methods and, being value types, C# 7 tuples are more memory efficient than <code>System.Tuple<\/code>, resulting in fewer allocations).<\/li>\n<li><strong>Pattern-matching<\/strong> lets you declaratively test the shape and contents of a value while extracting data into variables. This makes for more expressive type tests and switch statements.<\/li>\n<li><strong>Local functions<\/strong>, <strong>ref returns<\/strong>, <strong>binary literals<\/strong> and more.<\/li>\n<\/ul>\n<p>The example below demonstrates multiple C# 7 features: pattern matching, tuples, local functions and binary literals.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/kuhlenh\/d3f9cfbf10b60e13105fee6dd86dc7c0.js\"><\/script><\/p>\n<p>Share your feedback on C# 7 with us on our <a href=\"https:\/\/github.com\/dotnet\/roslyn\/issues?q=is%3Aopen+is%3Aissue+label%3A%22Area-Language+Design%22\">GitHub<\/a> or tweet <a href=\"https:\/\/twitter.com\/roslyn\">@roslyn<\/a>, we\u2019d love to hear what you think!<\/p>\n<h2><a id=\"user-content-the-productivity-of-visual-basic-15-coming-in-rc\" class=\"anchor\" href=\"#the-productivity-of-visual-basic-15-coming-in-rc\"><\/a>Visual Basic 15 (upcoming)<\/h2>\n<p>The next version of the Visual Basic language is also getting enhancements in Visual Studio &#8217;15&#8217;. We&#8217;re hard at work finishing up the last of these at the moment and expect to have them in the one of the next\u00a0Visual Studio &#8217;15&#8217; pre-release\u00a0releases.<\/p>\n<ul>\n<li><strong>Tuples<\/strong>\u00a0for Visual Basic are the same as for C#. The straightforwardness is truly in line with VBs design philosophy.<\/li>\n<\/ul>\n<p><script src=\"https:\/\/gist.github.com\/kuhlenh\/2e9e7c483b337fe2d5d0e27b0fff1b6f.js\"><\/script><\/p>\n<ul>\n<li><strong>Binary literals<\/strong> are another great new feature in the spirit of Visual Basic. Long have programmers had to mentally map decimal and hexadecimal numbers to their binary bit patterns. Soon you will be able to express this fundamental concept of computer programming\u2014binary\u2014natively in VB. To support this, we\u2019re also adding the ability to put underscores as digit group separators in the middle of numeric literals. These characters are purely cosmetic but make reading binary and other large literals much easier.<\/li>\n<\/ul>\n<p><script src=\"https:\/\/gist.github.com\/kuhlenh\/c7bce1a9039e87da1af195507155a42e.js\"><\/script><\/p>\n<p>Join the discussion on Visual Basic 15 language design in <a href=\"https:\/\/github.com\/dotnet\/roslyn\/issues\/11370\">this issue<\/a> or <a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2016\/05\/31\/tuple-tuesday\/\">this issue<\/a> on the Roslyn repo, or tweet <a href=\"https:\/\/twitter.com\/ThatVBGuy\">@ThatVBGuy<\/a>.<\/p>\n<h2><a id=\"user-content-intellisense-improvements\" class=\"anchor\" href=\"#intellisense-improvements\"><\/a>IntelliSense Improvements<\/h2>\n<p>In Preview 3, we&#8217;ve enhanced IntelliSense to make you more productive when working in a large solution or an unfamiliar codebase. This release we&#8217;ve added an icon tray to IntelliSense that allows you to filter your member list by type (e.g., methods, properties, classes, etc.). Each filter toggle has an associated keyboard shortcut which you can discover by hovering your cursor over the icon.<\/p>\n<p><img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2016\/07\/intellisense.png\" alt=\"IntelliSense improvements in VS '15' Preview 3\" \/><\/p>\n<p>To enable this feature, go to <em>Tools &gt; Options &gt; Text Editor &gt; [C# | Visual Basic] &gt; IntelliSense<\/em> and check the options for highlighting and filtering.<\/p>\n<h2><a id=\"user-content-more-quick-actions-and-refactorings\" class=\"anchor\" href=\"#more-quick-actions-and-refactorings\"><\/a>More Quick Actions and Refactorings<\/h2>\n<p>We added the following refactorings and code actions to assist your code writing process:<\/p>\n<ul>\n<li><strong>Add braces (C# only)<\/strong>. Allows you to add braces to the body of an if-else statement. This lets you quickly convert a single line if-statement to multiline with a single click.\n<img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2016\/07\/addbraces.png\" alt=\"Add Braces code action\" \/><\/li>\n<li><strong>Convert property to method (C# and VB)<\/strong>. Sometimes properties start to grow into functions that perform logic. This refactoring will let you transform these logic-heavy properties into methods.\n<img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2016\/07\/property2method.png\" alt=\"Convert Property to Method code action\" \/><\/li>\n<li><strong>Add missing switch\/Select case (C# and VB)<\/strong>. This action will figure out which cases you are missing in your switch\/Select and add them for you.\n<img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2016\/07\/missingswitch.png\" alt=\"Add Missing switch\/Select case code action\" \/><\/li>\n<\/ul>\n<p>To trigger a refactoring or code action, place your cursor in the expression and use the keyboard shortcut <code>Ctrl+.<\/code> or right-click and choose <strong>Quick Actions and Refactorings<\/strong>.<\/p>\n<p>Try out C# 7 and other features in <a href=\"https:\/\/go.microsoft.com\/fwlink\/?LinkId=746567\">Visual Studio &#8217;15&#8217; Preview 3<\/a> today! As usual, share your thoughts and feedback with us by filing issues on our <a href=\"https:\/\/github.com\/dotnet\/roslyn\/issues\">Roslyn repo<\/a>.<\/p>\n<p>Over &#8216;n&#8217; out,\n<strong>Kasey Uhlenhuth<\/strong>, Program Manager, <strong>.NET Managed Languages<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of our major focuses in Visual Studio \u201815&#8242; is improving developer productivity inside the editor. As we develop, we all perform series of actions over and over again&#8211;like writing methods, renaming variables, changing method signatures, implementing interfaces, etc. Our goal is to help automate or reduce these tasks to a single click so that [&hellip;]<\/p>\n","protected":false},"author":350,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[],"class_list":["post-6185","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet"],"acf":[],"blog_post_summary":"<p>One of our major focuses in Visual Studio \u201815&#8242; is improving developer productivity inside the editor. As we develop, we all perform series of actions over and over again&#8211;like writing methods, renaming variables, changing method signatures, implementing interfaces, etc. Our goal is to help automate or reduce these tasks to a single click so that [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/6185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/350"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=6185"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/6185\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=6185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=6185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=6185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}