ReSharper 2021.1

Inclut des mises à jour pour l'analyse de code, la prise en charge des modèles d'itinéraire d'ASP.NET et le changement de nom pour les composants Tuple.
Avril 12, 2021
Nouvelle Version


Code Analysis

  • More patterns to merge - The Merge into pattern inspection can now deal with many more code patterns:
    • Rewrite checks from conditional?.Access expressions to nested pattern matching.
    • Reduce if statement nesting by merging the checks together.
    • You can merge patterns inside a simple var (a,b) deconstruction pattern by expanding them to full forms.
  • More C# 9.0 Support - Added more support for C# 9.0 records:
    • The Extract interface and Extract superclass refactorings now work with record declarations, as do File Layout and the features that have to do with XML documentation.
    • Added a new set of inspections and actions.
      • Redundant explicit property declaration for properties in record declarations can be of help while migrating your code to use records with positional parameters and implicit property declarations. A corresponding quick-fix and Remove explicit property is now included.
      • The Redundant 'record' type declaration body inspection and the corresponding quick-fix will now replace the empty record type declaration body with a semicolon.
      • If you decide to turn a record into a class, the To class action will take care of the positional parameters and primary constructor. There’s a To record action that works the opposite way as well.
      • Whenever you need to rewrite positional parameters and a primary constructor to ordinary properties, constructor and an explicit Deconstruct() method, consider using the To explicit constructor context action.
      • Find usages now searches for the usages of a record’s primary constructor and for the usages of an implicit Deconstruct() method.
  • Inline temporary variable - Added a new inspection, Inline temporary variable. ReSharper can now help you find bugs if the temporary variable was supposed to be initialized to some other value or mutated later in code.
  • Other Improvements:
    • Logical not patterns can help you make your type checks much easier to read. Rider now offers dropping the !() syntax in favour of a not pattern.
    • For C# 10.0 support, ReSharper now works with the Constant interpolation strings feature.
    • ReSharper now suggests using the range operator instead of Slice and Substring, if doing so simplifies the code.
    • The Namespace does not correspond to file location inspection is now suppressed in files with top-level code.
    • There’s another new inspection that checks whether an auto-property can be replaced with a computed property, along with a quick-fix to make the replacement.

Microsoft ASP.NET Core route templates

  • Added support for route templates. ReSharper now provides code completion, structural navigation, inspections and quick-fixes, including:
    • The most basic inspections check route template syntax errors: accidentally placing a catch-all parameter route in the middle of the template, declaring the catch-all parameter as optional, adding a default value for the optional parameter and so on.
    • Parameters can be missing, in this case, ReSharper will suggest you add them, either from the controller’s attribute or from the action. If there’s a type constraint, it will be used to infer the type of the parameter.
    • ReSharper checks whether the applied constraint itself is correct and whether a parameter actually satisfies the constraint. It also tries to analyze whether the parameter type can be more strict, based on the constraint, and may suggest changing the type.
    • ReSharper is aware of custom constraints as well.

Rename in Tuples

  • Added the ability to rename the Named tuples components. You can now call the refactoring.


  • Adds a new navigation action – Navigate to Microsoft Windows Explorer.
    • Located in the Navigate | Navigate to menu or by pressing Ctrl+Shift+A and typing its name.
    • Useful if you are doing something with the file itself, like copying it or copying the path inside the repository, or if you prefer to view the file’s VCS history using Git extensions for Windows Explorer.


  • Improved typing speed in Razor files inside large solutions.
  • Improved typing speed in any large files where ReSharper’s analyzers are working.
  • Improved the performance and responsiveness of debugger data tips.
  • Optimized how ReSharper deals with shared documents, so it now consumes less memory.
  • Added performance improvements for JavaScript and TypeScript unit testing.

Formatting and Code Styles

  • You can now choose whether to set a space before and within target-typed new() parentheses.
  • You can specify wrapping before the assignment operator.
  • You can outdent label statements.
  • For custom naming rules, the order in which they are applied has been updated – more specific ones now go first.
  • Added a new action for Format Selection. You can now tell ReSharper to only adjust the indents for the selected code instead of performing the whole reformatting process.


  • Improved how ReSharper reads settings for naming rules from EditorConfig and writes the user-defined naming rules to EditorConfig.
  • If the naming rules are overridden in EditorConfig, ReSharper shows a notification on the naming settings page.
  • Added support for the csharp_indent_case_contents_when_block option in EditorConfig.

Unit Testing

  • Added support for VSTest adapters – allows you to discover and run tests from a third party framework.
  • Added MSTest support in Universal Windows Platform projects for Microsoft Visual Studio 2019.
  • Added a setting for the default course of action if you encounter the "spawned processes" issue. You can now choose between being asked what to do, doing nothing and terminating the spawned process. And when you’re being asked about a process and decide what to do with it, your decision is saved to ReSharper. You can always delete it if it was wrong.
  • Added a set of inspections for the AutoFixture library in NUnit. ReSharper now checks whether the test value type is correct, verifies that there are no redundant arguments in the [InlineAutoData] attribute, and warns you if there is no [TestFixture] or [Test] attribute on the test class or method.
  • Upgraded support for QUnit to version 2.14.0.

Other Updates

  • Added an action for copying GitHub links with the Copy FQN feature. When you call Copy Fully-qualified name from the main menu or from the Ctrl+Shift+A, ReSharper does the copying and opens a context menu where you can choose from a variety of formats in case you need a non-default one. This menu now includes GitHub links.
  • If you use regular expressions in strings in C#, VB.NET, or JavaScript, even in Razor pages, you’ll appreciate the extend/shrink selection feature, which now works in injects as well.
  • Added type conversion hints for tuple conversions.
  • A new Body constraint is now available for methods in File Layout which allows you to specify different rules for block-bodied and expression-bodied methods.


  • C++ Support - ReSharper C++ 2021.1 brings support for several new C++20 and C++17 language features:
    • Class types in non-type template parameters.
    • C++20 class template argument deduction rules and noexcept as a part of the function type.
    • There are also new code completion items for coroutines available both in basic code completion and as postfix completion templates:
      • co_await.
      • co_yield.
      • co_return.
  • C++ Syntax Style - Added a collection of syntax style settings that you can use to enforce the chosen code style for the syntax constructions. With the supporting inspections, quick-fixes and the Apply Syntax Style and Cleanup selection context actions, you can apply the new style to the codebase with ease and keep the new code consistent.


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 .