Dotnet logo

.NET Tools

Essential productivity kit for .NET and game developers

.NET Tools News Releases

ReSharper 2022.2 Comes With C# 11 Support, Solution-Wide Analysis Optimizations, and Virtual Formatter

Hello everyone,

We just released ReSharper 2022.2 and other JetBrains .NET tools and Visual Studio extensions. In this blog post, we’ll go through the highlights of this major update for ReSharper and ReSharper C++. To learn more about our other .NET tools, including dotCover, dotMemory, dotPeek, and dotTrace, please check out this separate blog post

ReSharper

C# 11 support

This release brings support for several more features from the C# 11 preview:

  • ReSharper 2022.2 is now aware of the required keyword for members inside a class, struct, or record type, and provides additional support for the “required” keyword in code completion. We’ve also added a new Add initializer for required members quick-fix for cases where you’ve created a type’s object, but haven’t initialized the members yet.

  • There are several more inspections and a context action to support checked user-defined operators. ReSharper also shows all of the compiler errors and warnings. 
  • We’ve added basic “raw” string support including compiler errors and correct parsing and color highlighting for “”” syntax, pairs of double quotes, and placeholders inside interpolated strings ({{...}} syntax).
  • ReSharper 2022.2 fully supports list patterns with error checking, code completion, and code analysis. We are still working on adding code inspections to suggest using the list patterns in existing code and additional refactoring actions.

Solution-Wide Analysis optimizations

We’ve greatly optimized the memory usage of ReSharper with the Solution-Wide Analysis mode turned ON, both in terms of memory traffic (number of memory allocations) and memory consumption.

Before vs After

General C# code analysis improvements

  • For those using top-level statements in their code, ReSharper 2022.2 adds the new context action To explicit ‘Program’ class to execute a transformation to the old style. It helps when the explicit startup class Program is necessary or more desirable to use. We’ve also implemented a new Convert to top-level code context action.
  • We reworked our INotifyPropertyChanged support and supported more MVVM frameworks and INotifyPropertyChanged base classes. We now emit a SetField method that enables the most concise syntax for INotifyPropertyChanged notifications.
  • We reviewed the most commonly used refactorings to increase their discoverability and introduced related context actions in the Alt+Enter menu that depend on the current context.
  • There are more suggestions for using a nameof operator. ReSharper 2022.2 now recognizes the registrations of DependencyProperty in WPF projects and suggests using a nameof operator to capture the corresponding CLR property name. Built-in live templates were also updated to emit nameof instead of string literals.
  • Quick-fixes which come from Structural Search And Replace patterns can now be applied in the scope of a file, folder, project, or entire solution. 

Virtual Formatting

We’ve introduced the Virtual Formatter — a way for you to view code in your desired formatting without actually reformatting the source code on the disk. For example, you can now virtually align parameters in columns or increase indents. Our goal with this feature is to improve code readability and maintainability and make it more accessible for visually impaired and neurodivergent developers. 

Disk Cleanup

You can now remove temporary files generated by ReSharper while it is working on your code. There is a new Disk Cleanup page in Options to manage the default paths, files, and custom path templates and to set up and run automatic or manual cleanup. 

Other updates

  • JavaScript and TypeScript support in ReSharper is outdated and slow. It was difficult to follow TypeScript language changes and support new versions quickly, so we’ve decided to put our current JavaScript/TypeScript support on hold and disabled it by default in this release. We are looking for a better way to support these languages.
  • ReSharper can now detect if the StyleCop.Analyzers package is referenced by a project and read its settings from the stylecop.json and .ruleset files.
  • The way ReadyToRun (R2R) and NGen assemblies are presented in the Assembly Explorer has been improved. A small processor symbol icon and ngen or R2R labels are now displayed next to each assembly’s name. The Metadata tree has the ReadyToRun header.

If you are eager to learn more about all these ReSharper features, please visit the What’s New page. You may also want to review the full list of requests we’ve addressed this release cycle in our public bug tracker.

ReSharper C++

ReSharper C++ now reads Blueprints and introduces a new type of hint to help you see how Blueprint designers use and extend the baseline system implemented in the C++ part of your Unreal Engine game. With the new Blueprint hints, you’ll be aware of derived Blueprint classes, UFunction implementations, and the write access to and default values of UProperties.

Among other improvements, the indexing speed of Unreal Engine code has been significantly increased. As a result of caching precompiled headers, ReSharper C++ now indexes the engine code up to twice as fast as before. 

For more details, please see this dedicated blog post.


You can download the release build from the ReSharper 2022.2 page or install it using the JetBrains Toolbox App. We appreciate any feedback you have about the new features!

image description