ReSharper 2022.1

Améliore la prise en charge de C#10 et Blazor.
Avril 21, 2022
Nouvelle Version


  • C# support
    • Improve support for C# 10, particularly global usings. Added 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.
  • Nullable reference types
    • Warnings for null checks on expressions that should never be null into two categories have been split. 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.
    • 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
    • Endpoints support now works for Microsoft ASP.NET Core 6 minimal APIs and convention-based routing. It includes navigation, code analysis, and code completion.
  • Razor and Blazor
    • Added support for the new [EditorRequired] attribute from Microsoft .NET 6. The corresponding inspection and quick-fix are also available if you try to use a Blazor component without specifying the required parameters.
    • Added support for C# local functions inside Razor syntax.
    • Improved the Code Cleanup in .razor files with Blazor components. It no longer removes all @using declarations.
    • Added navigation through inheritance hierarchy to Razor code. The corresponding gutter marks are now shown for base and derived symbols. You can click them to navigate to the code.
  • Code Cleanup and Formatting
    • Reorganized all the items in the Alt+Enter menu related to Code Cleanup and Formatting.
    • The Format selection, Cleanup selection, and Apply syntax style have been 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.
  • 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.
    • This release also shows you an overloading warning when an emplace-like function is called with incorrect arguments.
  • Source generators
    • Increased the delay between requests when fetching source-generated documents from the compiler. The source generators are not run before the compiler and the total amount of CPU work is reduced.
  • ReSharper Command Line Tools
    • The InspectCode tools can now 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.
    • Turned off navigation retargeting in the Metadata view.
    • 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.
    • Improved the PDB navigation for types without sequence points, for example, interfaces and enums.
  • Other updates
    • Improved the Move type to file refactoring, which also includes a context action and quick-fix. Preprocessor directives are now moved along with the type in common cases.
    • 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.
Improved support for C#10 in ReSharper 2022.1.


Augmentez votre productivité .NET.

ReSharper est également disponible en :

Vous avez une question ?

Discutez en direct avec l'un de nos spécialiste des licences JetBrains .