NDepend

Improve your .NET code quality with NDepend

3 productivity Resharper features missing in Visual Studio

Resharper is a great Visual Studio productivity extension but on the other hand it slows down significantly the IDE, especially when working with large solutions. However there are real hopes that soon  Resharper in VS will get faster, both because Visual Studio 2022 will run in a 64 bits process with (almost) unbounded memory, and because Jetbrains engineers are currently moving Resharper out-of-proc.

Since the introduction of the Microsoft Roslyn compiler in 2015, the Visual studio engineers made massive progresses in areas like code analysis, refactoring, navigation and searching. If you are not aware of these improvements you can read these two articles that illustrate them: Top 10 Visual Studio Refactoring Tips and 10 Visual Studio Navigation Productivity Tips. Hence one might disable Resharper periodically to check if he can live without it to get a slimmer and faster Visual Studio.

As a more than a decade Resharper user, a more than two decades Visual Studio user and a Visual Studio extension author, my opinion is necessarily biased. Nevertheless I feel that only a few improvements in Visual Studio could lead me to live without Resharper. Here are the three most prominent ones.

Preemptive Import

One thing that I love with Resharper is that when some code gets copy-pasted, the tool almost forces the user to accept importing the missing using clauses. The tool could import the using clauses itself but this would sound awkward and in some cases some choices have to be made if several types with the same name are declared in different namespaces. Thus this preemptive tooltip that reminds the (Alt+Enter) keyboard shortcut is the right balance IMHO.

Resharper-Killing-Feature

On the other hand, when some code gets copy-pasted Visual Studio takes a second to underline the error with a squiggle. Then the user has to move the caret over the error and then press (Ctrl+dot), a well known keyboard shortcut for any seasoned Visual Studio user. This is less immediate than the Resharper way. Since copy-pasting is a common action, this missing feature is one of the tiny annoying thing that makes me goes to Visual studio > Option> Resharper > Resume Now.

The-Visual-Studio-Way


Update: Visual Studio 2022 now automatically adds the using clause upon copy-pasting, so cool!!!

The-Visual-Studio-2022-Way

If the identifier is declared in more than one namespace the user experience falls back to the Ctrl+dot one presented above:

The-Visual-Studio-2022-Way2

Find All References/Usages Panels

Many times a day as a developer, we need to locate all references of a code element. Both Resharper and Visual Studio proposes this feature. But I found the Resharper way of presenting usages much clearer (left side on the screenshot below) than the Visual studio way (right side on the screenshot below).

Resharper-find-all-usages-vs-Visual-Studio-find-all-references

Again my opinion is subjective and I understand if some Visual Studio users prefer the pruned Visual Studio way of presenting usages. Moreover Visual Studio uses code highlighting in this panel which is neat. On the other hand the [Containing XXX: Unknown] rows are confusing and useless (Group by mode is: Project, Containing type, Containing member). Also Visual Studio uses the bold font to highlight all parent nodes which lead to a cluttered result.

Most of information presented in the Resharper Find Results panel are essential to me. My developer eyes are exercised to read and make the most of this data quickly:

  • The search target reminder
  • Bold font is kept only for located usages
  • Source line and column numbers highlighted with a dedicated color (blue)
  • The containing methods, the containing types and the containing project are shown with the standard icons aside
  • Light gray is used to highlight extra data like the number of child items and the types’ namespaces
  • The top bar proposes several actions on the result (export, expand/collapse, merge on same line when possible, filter usages…)

All those information are easily provided by the Roslyn model and it would be valuable that the Visual Studio team presents them, at least optionally.

Variable values displaying into the editor at Debugging time

Since 2017 Resharper is bringing debugger live data into the editor. Even though Visual Studio natively offers tons of great Debugging features, this one really helps. The Visual Studio debugger already knows about these values and positioning them properly in the source editor at debugging time shouldn’t be that complicated.

Resharper-Debugger-Info-In-The-Code-Editor

Btw with Seed: the screenshot above also demonstrates another great Resharper feature: argument name at calling site when it is not obvious. (Update: this feature exists in VS in experimental mode Tools > Options > Text Editor > C# or Basic > Advanced > Display inline parameter name hints (experimental) ).

Conclusion

Since 2015 the Visual Studio team put significant efforts in implementing modern coding productivity features that were only available with some extensions like Resharper or CodeRush so far. In my opinion they succeeded to a large extend with Visual Studio 2019 and Visual Studio 2022 will go even further in that direction. Apart that the Visual Studio engineers are also introducing some innovative features promised to a bright future like AI assisted coding with Intellicode and Visual Studio 2022 Hot Reload to edit code at runtime.

On the other hand a few missing features massively contribute to my Resharper addiction because I use them very often. In my development flow it is not acceptable to miss those facilities. Interestingly enough those improvements would represent a tiny fraction of the effort made by the Visual Studio team in the productivity field.

This shows well the importance of usability and ergonomy. Here is the lesson: there are certainly many small usability potential improvements in our product and in your product that would make it more attractive. Let’s listen even more to user’ feedbacks to spot them!

My dad being an early programmer in the 70's, I have been fortunate to switch from playing with Lego, to program my own micro-games, when I was still a kid. Since then I never stop programming.

I graduated in Mathematics and Software engineering. After a decade of C++ programming and consultancy, I got interested in the brand new .NET platform in 2002. I had the chance to write the best-seller book (in French) on .NET and C#, published by O'Reilly (> 15.000 copies) and also did manage some academic and professional courses on the platform and C#.

Over the years, I gained a passion for understanding structure and evolution of large complex real-world applications, and for talking with talented developers behind it. As a consequence, I got interested in static code analysis and started the project NDepend.

Today, with more than 8.000 client companies, including many of the Fortune 500 ones, NDepend offers deeper insight and understanding about their code bases to a wide range of professional users around the world.

I live with my wife and our twin babies Léna and Paul, in the beautiful island of Mauritius in the Indian Ocean.

Comments:

  1. As I would like to think they prevailed to an enormous reach out with Visual Studio 2019 and Visual Studio 2022 will head significantly further toward that path.

Comments are closed.

open