Visual Studio 2019 .NET productivity

KendraHavens

Kendra

Your friendly neighborhood .NET productivity team (aka. Roslyn) focuses a lot on improving the .NET coding experience. Sometimes it’s the little refactorings and code fixes that really improve your workflow. You may have seen many improvements in the previews, but for all of you who were eagerly awaiting the GA release here’s a few features you may enjoy!

Tooling improvements

I’m most excited about the new Roslyn classification colors. Visual Studio Code colors received high praise so we incorporated similar color schemes into Visual Studio. Your code editor is now just a little more colorful. Key words, user methods, local variables, parameter names, and overloaded operators all get new colors. You can even customize the colors for each syntax classifications in Tools > Options > Environment > Fonts and Colors and scroll to ‘User Members’.

New roslyn classification colors

At the bottom of files in your editor are the document health indicators as well as our code cleanup icon. The document health indicators let you know at a glance how many errors and warnings are present in the file you currently have open. You can click on the code cleanup icon to apply code style rules specified in Tools > Options or, if you have an editorconfig file that shares one code style across your team, it will apply styles specified in that file.



You can edit sdk-style project files with a simple double-click! You can also view these project files with preview in GoToAll (Ctrl+t) navigation and search the contents for file references.



Load a subset of projects in your solution with filtered solutions! You can now unload projects and save a .slnf file that will only open the projects you specified. This helps you get to the code you are interested in quickly without needing to load an entire solution.

Open only a subset of projects in a solution with solution filters

Find all references categorizes by reference type. You can filter by read/write in the new ‘Kind’ column in the find all references window.

Filter references by Read/Write with Find All References

Run code style formatting over the entire solution at the command-line with the dotnet format global tool.




Intellicode is an extension offering smarter intellisense completion with machine-learning trained models run over 2,000 open source .NET repositories on GitHub.

Intellicode offers smarter suggestions based on your scenario

Now the omnibus of new code fixes and refactorings!

 

Foreach to LINQ




 

Add missing reference for unimported types




 

Sync namespace and folder name




 

Invert conditional expressions




 

Pull members up dialog for promoting members to an interface




 

Wrap/indent/align parameters/arguments




 

Remove unused expression values and parameters




 

This is a set of highlights of what’s new in Visual Studio 2019, for a complete list see the release notes. As always, I would love your feedback via twitter, on GitHub, or in the comments section below. Also, one important thing to note is that to use .NET Core 3.0 Preview you will need to download and install the SDK, it is not included with the Visual Studio 2019 installer yet.

KendraHavens
Kendra Havens

Program Manager, .NET and Visual Studio

Follow Kendra   

11 Comments
Avatar
Varun Sharma 2019-04-02 19:29:35
Hi Kendra, thanks for the great detailed article. In one of the GIFS you have a terminal window opened. How did you get that? Also looks like it's a power shell window. Thanks.
Avatar
Nigel Smith 2019-04-03 02:26:14
Hi Kendra, is the code refactoring (like 'Convert foreach loop to LINQ' and 'Convert anonymous type to tuple') available in the Community Edition? I've just downloaded the release version of CE, and I cannot get these 'Quick Actions' to be available :-(
Paul Lorica
Paul Lorica 2019-04-04 08:43:04
Any way to change back the colors? Im not a huge fan of the new text colors. Too many distracting colors.
Avatar
Matteo Bagattini 2019-04-08 06:38:41
Silly question: I've noticed you moved from GIF to incorporated videos. Any tip about tools you use to record such videos? Could be very helpful to incorporate such media in our documentation website
Yahor Sinkevich
Yahor Sinkevich 2019-04-10 04:35:53
Could you please consider improving intellisence when adding package reference, like a list of packages and then available versions. This is now available as project tools extension but IMHO must have as we're adding refrences manually via project file these days.