Connect(); Special Issue 2018
Volume 33 Number 13
What's New in Visual Studio 2019
By Mads Kristensen; Special Issue 2018
Visual Studio 2019 introduces exciting improvements and new features aimed at optimizing developer productivity and team collaboration. Whether you’re using Visual Studio for the first time or have been using it for years, you’ll benefit from features that improve all aspects of the development lifecycle—from smoother and more focused project creation to cloning from repository workflows, to driving the maintainability and quality of your code. Team and open source collaborative workflows are improved, as well.
One of the goals of the Visual Studio team was to make the upgrade to Visual Studio 2019 as seamless and simple as possible. So you’ll find that there are no breaking changes in the format of solution and projects files when you step up, and that your existing code should open as expected.
There’s more good news. The extensibility APIs in Visual Studio 2019 remain relatively unchanged, which means that any extension you use in Visual Studio 2017 can be updated with minimal effort to support Visual Studio 2019. Many extensions have been updated already, ensuring that they’re available to you for the preview release. Updated extensions include Productivity Power Tools, Web Essentials, VsVim and many other popular extensions on the Visual Studio Marketplace today.
There are two other areas of particular interest to customers: performance and reliability. We’ve been shipping preview builds of new versions of Visual Studio for years, with updates more recently being released on a quarterly basis. These previews give you an early look at what’s coming so you can work with the preview bits, and provide feedback to the Visual Studio product team. They also help you start thinking about how the new capabilities might impact you and your organization. Finally, these previews provide us with valuable feedback about issues in various user scenarios, as well as insight into how features might be tweaked to deliver the highest-quality product.
So, let’s take a closer look at what you can expect to find in the preview of Visual Studio 2019.
Easier to Launch Your Code
The first thing you’ll notice when you open Visual Studio 2019 is the new Start window, shown in Figure 1. It presents you with options to clone or check out code, open a project or solution, open a local folder, or create a new project. Whether you’re new to Visual Studio or new to coding, or have been coding and using Visual Studio for years, these capabilities make getting to your code faster and more focused than ever.
Figure 1 The New Start Window
We’ve concentrated on improving the time it takes to load solutions and projects, whether these are small or very large. Not only will solutions load faster, they’ll do more of the work in the background, preventing extended UI delays and hangs during initialization.
It’s worth noting that it’s now possible to start a project by cloning or checking out from source control directly from the Start window. Bringing this feature front and center to the Start window finally makes it as simple as it should be.
When you create a new project, Visual Studio will open a redesigned project creation dialog. We received a lot of feedback about the old project dialog, so we optimized the experience to give you powerful search and filtering capabilities up front. This makes it easier to discover the right template for your new project. The same dialog is used on both the Start window and inside Visual Studio.
Previous versions of Visual Studio made finding the right template for your app challenging, with the hundreds of templates shipped with Visual Studio, plus the thousands more made available for download by the community. The new dialog eases this task by bringing the most popular templates forward, while making it easy to browse templates and quickly filter them based on language, platform and project type.
Now you open the project creation dialog and the focus is directly in the search box, which filters the template list in real time as you type. The project creation dialog has always had a search box, but it never felt as natural, fast and convenient as it does in Visual Studio 2019.
More updates are coming to the project creation dialog, such as a list of your most recently used templates and other enhancements.
To increase productivity, Visual Studio contains several updates to improve the UI and your experience, so you can focus on what matters—your code. When Visual Studio opens, you’ll immediately notice some changes from previous versions. One of the most visible changes is the updated blue theme with softened edges around icons, toolbars and tool windows. This is the first major update to the blue theme since its introduction in Visual Studio 2012 and is a modernization of the interface. Similar updates to both the Light and Dark themes are planned for a future update.
Another visible change is the top-level menu, which has been moved up into the title bar, reclaiming vertical space to make room for more code in your editor. This change optimizes available space without changing how you navigate the IDE.
In future updates, expect to see additional subtle changes designed to simplify the UI while bringing focus to your projects and code documents.
A Better Search
The search feature, formerly known as Quick Launch, has been completely rewritten to make it faster and more accurate. It even provides a more forgiving search experience that can work with spelling mistakes.
Whether you’re looking for commands, settings, installable components or other useful things, the new search feature makes it easier than ever to find what you’re looking for within the IDE. Keyboard shortcuts are displayed next to search results for commands, so they can be more easily memorized for future use, as shown in Figure 2.
Figure 2 The New Search Feature
The new search helps speed things up by displaying results dynamically as you type in your query. It also accommodates for spelling mistakes and more natural language by using a fuzzy search algorithm. Finally, the results displayed have been refreshed to provide more relevant information, including any associated shortcuts for the keyboard-driven developer.
Initially, you can search across menus, commands, options and installable components. The Visual Studio team will continue to expand on search accuracy and incorporate other search providers to work toward providing a centralized search experience. You’ll also notice that search has been moved up into the title bar, giving it a more prominent position that’s easy to locate and out of the way when not being used.
IntelliCode is a set of AI-assisted capabilities that improve developer productivity, with features like contextual IntelliSense, code formatting and style rule inference. More improvements are in the works, including focused reviews for your pull requests in future updates. IntelliCode is an optional extension for both Visual Studio 2017 and 2019, and has received some major updates that make it even better. You can download the updated IntelliCode extension at aka.ms/vsintellicode. Read more about IntelliCode and its improvements in the post on The Visual Studio Blog at aka.ms/vsicblog.
Until now, IntelliCode recommendations have been based on learning patterns from thousands of open source GitHub repos. But what if you’re using code that isn’t in that set of repos? Perhaps you use a lot of internal utility and base class libraries, or domain-specific libraries that aren’t commonly used in open source code, and you’d like to see IntelliCode recommendations for them, too. If you’re using C#, you can have IntelliCode learn patterns from your code, so it can make recommendations for things that aren’t in the open source domain.
When you open Visual Studio after installing the updated IntelliCode extension, you’ll see a prompt that lets you know about training on your code, and will direct you to the brand new IntelliCode page to get started. You can also find the new page under View | Other Windows | IntelliCode. Once training is done, it will let you know about the top classes for which it found usage, so you can just open a C# file and start typing to try out the new recommendations. The trained models are kept secured, so only you and those who have been given your model’s sharing link can access them. Your model and what it learns about your code stay private to you.
CodeLens for Everyone
CodeLens has been a feature found only in Visual Studio Enterprise, but that will change in an upcoming preview of Visual Studio 2019, when it will also be available for the Community edition, likely in 2019. CodeLens shows the number of references a type or method has, information about unit tests covering the method, and data directly from Application Insights.
In addition, Microsoft has made CodeLens fully extensible, so third-party extensions can start to add their own experiences on top of it. CodeLens makes key information about your types easy to find, while keeping you in the source code. Lenses for source control history and IntelliTrace are still an Enterprise-only feature.
It can sometimes be easy to overlook an error, warning or suggestion in your code, because it has scrolled out of view or the Error List window isn’t visible. Those issues often aren’t caught until the next time the project is built. On top of that, warnings and suggestions based on code style rules from .editorconfig files or code analyzers can go unnoticed and might not get caught until it’s time for a code review before committing the code changes to source control.
Situations like these could be avoided if there were an always-visible indicator showing when the code file contains errors, warnings and suggestions. It would be even better if the available code fixes provided to take care of the warnings and suggestions could be applied to the whole code file—or even the project—in one fell swoop.
That’s why Visual Studio 2019 has added a document health indicator icon at the bottom right side of the editor (it’s likely to be relocated in a future update). The icon is red, yellow or green, indicating the health level of the code file or document. Figure 3 shows how this looks.
Figure 3 The Document Health Indicator
Right-clicking the indicator icon will show shortcuts for dealing with any issues in the document, as well as run a full document-wide cleanup process. The cleanup will format the code and apply any code fixes suggested by the current settings, .editorconfig files or Roslyn analyzers.
This is a huge productivity boost designed to help you write more maintainable code faster, and to deal with issues earlier, before they enter a code review. It’s important to note that this feature is undergoing some UI work for future updates, but the Visual Studio team decided to ship this early UI already in Preview 1 to maximize your productivity and hopefully get feedback from you to make this capability even better.
Visual Studio 2019 aims to improve your productivity in everyday tasks, reducing everyday friction. One of the new features helping reduce that friction is the ability to search in the various Watch windows (locals, auto and watch during debugging). You’ve probably been there before, looking in the Watch window for a string among a sea of values. Now, Visual Studio can do that looking for you!
In Figure 4 you can see a search for “pork,” which searches within the watch names, values and type columns. When you search, the software highlights any visible text matches and searches, based on the depth of the search, through the window. You can navigate through all found matches by using the Find next (F3) command. One of the challenges with searching a watch is that the data represented can be recursive, or you simply have a very deep parent chain. To get around this limitation, by default, we only search three levels deep. If you don’t find something, you can just use the Search Deeper button to search through the next two levels. You can also change the default search depth in Tools | Options.
Figure 4 Search Within a Watch Window
So, for the first time, you can now easily search through arrays of any kind to find just the item you’re looking for. This has traditionally been a pain point where you manually had to look at each item in the array to pinpoint the one you need. Now it’s as simple as typing in the search string.
We’ve done a lot in this release to improve performance. The Watch window and the other debugging tool windows such as Locals and Call stack have all undergone a redesign that allows them to load asynchronously. Now many of the processes that ran on the UI thread in Visual Studio run on a non-blocking background thread. The result is a clear improvement in performance and fewer UI delays or hangs while debugging.
Debugging has gotten better, too. In addition to improving the responsiveness of the debugger, we’re continuing the work started in Visual Studio 2017 to move memory-intensive components and workloads into separate processes. With Visual Studio 2019, components of the C++ debugger will run in a separate process, which means large memory-hungry programs can be debugged without Visual Studio running out of memory. And step debugging now provides faster and smoother step-through code, making it the best overall debugging experience yet.
A lot more improvements are coming to the debugger in future releases, both in the terms of new features and performance improvements.
In addition to the features mentioned in this article, there are powerful new team collaboration capabilities that promise to revolutionize developer interaction. Read more in Julie Lerman’s article, “Remote Collaboration with Visual Studio Live Share,” in this issue.
The features described in this article are just a sampling of what’s available in Visual Studio 2019 Preview 1. There are plenty more fixes, tweaks and additional functionality beyond what you’ve read about, including .NET Core 3 preview tooling, mobile development, cross-platform C++ and Azure features.
The Visual Studio 2019 Preview was not yet feature complete at the time of this writing, but it clearly shows the direction you can expect the final version of the product to take. If you haven’t already, now’s a good time to head over to visualstudio.com to download the preview and try out these new features for yourself.
Mads Kristensen is a senior program manager on the Visual Studio Extensibility team. He is passionate about extension authoring, and over the years he’s written some of the most popular extensions with millions of downloads.
Thanks to the following Microsoft technical experts for reviewing this article: Gordon Hogenson, Rajen Kishna
Rajen Kishna is a senior product marketing manager for Visual Studio
Gordon Hogenson is a content developer with the Developer Relations team at Microsoft. He works primarily on Visual Studio and Azure content on docs.microsoft.com.