What’s new in ReSharper 2022.1

2022.1 is about quality and brings a lot of improvements and bug fixes, specifically to Blazor development and C# support.

Download

Free 30-day trial available

C# support

We continue to improve support for C# 10, particularly global usings. We’ve implemented two new refactorings that are also available as context actions.

Extract Global Using can help you to introduce the concept of global usings in your project. You can invoke it on a regular using directive, and ReSharper will suggest extracting it to a designated GlobalUsings.cs file (if there’s no such file in your project yet, it will be created). The regular using that is no longer needed will be removed from the files in your project.

If you decide to refactor a global using into a regular using, Inline Global Using refactoring can help here, too. When called on a global using, it removes it from the GlobalUsings.cs and adds the corresponding using statement to the files in your project where required.

The global using feature is supported in Find Usages and in code analysis for extension methods.

We’ve looked into the approaching C# 11 and supported generic attributes.

Nullable reference types

  • We’ve split warnings for null checks on expressions that should never be null into two categories. The first warning is for expressions that are never null because an NRT annotation says so. The second warning is for expressions where there's an actual runtime check for null.
  • We’ve added a new setting for switching to runtime-enforced not null warnings only mode. It is accessible from the configuration item group in the Alt+Enter menu for annotation-based warnings.
  • [MemberNotNull] and [MemberNotNullWhen] annotations are now supported in projects that don't use nullable reference types.

Endpoints

Our Endpoints support now works for ASP.NET Core 6 minimal APIs and convention-based routing. It includes navigation, code analysis, and code completion.

Razor and Blazor

Here are some of the most notable features and fixes we’ve made for Razor and Blazor:

  • We’ve added support for the new [EditorRequired] attribute from .NET 6. The corresponding inspection and quick-fix are also available if you try to use a Blazor component without specifying the required parameters.
  • We’ve implemented long-awaited support for C# local functions inside Razor syntax.
  • We’ve improved the Code Cleanup in .razor files with Blazor components. It no longer removes all @using declarations.
  • We’ve also fixed the If To Switch and Invert If context actions in Razor code with references to Blazor components.
  • ReSharper now uses the correct naming style for Blazor injected properties.
  • The Comment with Line Comment action now comments only the part of the Razor code you’d expect it to.
  • We’ve added navigation through inheritance hierarchy to Razor code. Now the corresponding gutter marks are shown for base and derived symbols. You can click them to navigate to the code.

Code Cleanup and Formatting

We’ve reorganized all the items in the Alt+Enter menu related to Code Cleanup and Formatting. The Format selection, Cleanup selection, and Apply syntax style were combined into one Reformat and Cleanup item to provide a single entry point.

In addition to these changes, the syntax style settings are now available in the Configure code style and Autodetect code style settings actions. The Preview code style panel shows changes in syntax style as well.

Unreal Engine unit tests

The Unreal Engine testing framework is now supported. ReSharper C++ discovers Unreal Engine unit tests and adds the corresponding action indicators next to each test in the editor to run or debug the test or the whole test suite. In the Unit Test Sessions window, you can review the results of the tests, and rerun failed, all, or specific tests.

What’s new in ReSharper C++ 2022.1

Even better C++ support

ReSharper C++ is now better at handling implicit constructor calls, allowing you to find usages and navigate to the called constructor in more cases, including the following:

  • standard (make_unique/make_shared) and Unreal-specific (MakeShared/MakeUnique) smart pointer creation functions.
  • emplace-like container methods.
  • static_cast and c-style cast expressions.

ReSharper C++ 2022.1 also shows you an overloading warning when an emplace-like function is called with incorrect arguments.

What’s new in ReSharper C++ 2022.1

Source generators

After analyzing the performance of source generators’ support, we’ve decided to increase the delay between requests when fetching source-generated documents from the compiler.

Thus, the source generators are not run before the compiler and the total amount of CPU work is reduced. The exact performance gain depends on whether any other features also trigger the generators, like Visual Studio's full-line completion.

Performance

We’ve fixed a number of performance issues already and laid the groundwork for more. This includes dealing with performance snapshots from our customers, in-house profiling sessions, and gathering data to hopefully implementing automatic checks for performance degradations in the future.

As for the “out of process” mode, the work is ongoing. Please refer to the newest update in our issue tracker.

ReSharper Command Line Tools

The InspectCode tools can generate output files compatible with Static Analysis Results Interchange Format (SARIF).

Command line tools now support Alpine Linux.

Decompiler

  • The integrated decompiler now shows XML doc comments for platform assemblies, including assemblies whose names differ from the names of the XML documentation files, for example, System.Private.CoreLib. The path to the XML documentation is now displayed in the decompiled file’s header.
  • We’ve turned off navigation retargeting in the Metadata view.
  • We’ve added decoded / raw blob presentations in the properties for blob nodes.
  • The Assembly Explorer now supports forwarded types (the [TypeForwardedTo] attributes). The Locate in Metadata action also works for forwarded types, assembly and module references, and resources.
  • We’ve improved the PDB navigation for types without sequence points, for example, interfaces and enums.

What’s new in dotPeek 2022.1

Improved support for SQL Server events dotUltimate

Now dotTrace supports SQL Server events from the Microsoft.Data.SqlClient provider on Windows (.NET Core, .NET 5+), as well as macOS and Linux (.NET Core 3.0+, .NET 5+).

What’s new in dotTrace 2022.1

Attaching to applications with drag and drop dotUltimate

You can now attach the profiler to an already running application by simply dragging the special icon onto the application window.

What’s new in dotMemory 2022.1

Excluding code from coverage analysis using comments dotUltimate

You can now use comments to exclude certain lines or blocks of code from coverage analysis. Several options are available for this:

// dotcover disable
var i = 1;
var j = 10;
// dotcover enable

/* dotcover disable */ var i = 1; /* dotcover enable */

var i = 1; // dotCover disable this line

// dotcover disable next line
var j = 100;

For any of these options to work, you must reference the JetBrains.dotCover.MSBuild NuGet package. This is a development-only dependency that won't be included as a run-time dependency in your project.

What’s new in dotCover 2022.1

Other updates

  • We've made improvements to the Move type to file refactoring, which also includes a context action and quick-fix. Now preprocessor directives are moved along with the type in common cases.
  • We’ve fixed the “massive file system change” problem. It turned out to be an event buffer overflow. It caused ReSharper to review all files in the solution without any real cause, and that led to high CPU usage and, in some severe cases, UI freezes.
  • We’ve fixed the issue that hampered ReSharper’s functionality in .sqlproj files in localized Visual Studios.
  • We’ve added the Metadata tree view into ReSharper (only for Visual Studio 2022). It allows you to browse all the items inside the assembly metadata and provides search, navigation to sources, and more. For a full list of the features, please refer to the description in dotPeek documentation – the decompiler was the first product to have it.
  • We’ve addressed several long standing problems with “ReSharper shows red code on switching Git branches”. We’ve identified several particular scenarios where it happens and fixed them.
Download

Free 30-day trial available