ReSharper 2020.2

ReSharper 2020.2
Adds new inspections and quick-fixes for C#8 plus a revamped Unit Test Runner.

News

Feature Release

August 14, 2020 - 15:19
ReSharper 2020.2
New test runner

Code Analysis

  • Nullability code analysis is now aware of more cases and can trace incorrect nullability through deconstruction and the foreach cycle.
  • Code analysis now takes into account JetBrains.Annotations attributes (both NotNull and CanBeNull) for the API, even in code where nullable reference types are disabled.
  • Context actions for converting for each to LINQ and LINQ to code are also available on IAsyncEnumerable.
  • Now it’s possible to easily generate IEqualityComparer and IComparer implementations with the appropriate quick-fixes.
  • Code Analysis now takes compiler annotations into account when verifying the nullability of implemented or overridden members.
  • There are new inspections and quick-fixes to make variables and return types “not nullable” if they have never held or returned nullable values.
  • Code analysis is now able to follow the dotnet_diagnostic rules from the .editorconfig file.
  • Support for the default implementations in interfaces feature has been enhanced in this release. The left-hand gutter in the code editor shows that a method is implemented or overridden, and the refactorings and navigation are aware of this C# language feature.
  • Inlay hints are now available in XAML code. It provides hints for markup property names and DataContext, as well as for margins and paddings.
  • The Suppress nullable warning with ! quick-fix can be disabled for a solution via the Alt+Enter menu.

Code Cleanup

  • Now you can configure ReSharper to launch Code Cleanup automatically on saving a file. Third-party plugins are no longer needed for this functionality.
  • There are new, more granular scopes to run Code Cleanup, such as recently modified files and recently opened files, which can significantly reduce the time it takes to get a result as Code Cleanup doesn’t have to run over the whole solution.
  • Autosave files after code cleanup is finished.
  • There are a couple of improvements to reduce Code Cleanup execution time:
    • Cleanup does not run analyzers when collecting code to clean up unless the corresponding checkboxes are selected in the Cleanup profile.
    • Multiple code fixes are executed at the same time for a file. It no longer starts to re-highlight the file after each fix.

Unit Testing

  • Both Microsoft .NET Framework and .NET Core now have the same runner for both runtimes that run out of the Microsoft Visual Studio process.
  • The new test runner has built-in support for:
    • MSFakes for NUnit, xUnit, MSTest v2 unit test frameworks.
    • TypeMock Isolator for NUnit, xUnit, and MSTest v2.
  • ReSharper supports the DisplayName attribute in .NET Core tests for xUnit and NUnit frameworks.
  • Applying filters to the unit test tree, for example, Passed/Failed/etc. will mean the counters provide two separate numbers – the total number of all tests, and the number of tests that satisfy the filter criteria.
  • There are two new actions in the Navigate To menu:
    • Show all Unit Test Sessions that include this test.
    • Show the test in the Unit Test Explorer tool window.
  • Introduced support for NUnit's Assert.Multiple method, which makes it possible to check multiple assertions without the code exiting after the first failure.
  • Time ranges for grouping by duration can be edited directly in the options.

Accessibility improvements

  • This release comes with improved support for screen readers like JAWS, NVDA, and Microsoft Narrator. These screen readers now have better access to:
    • List and tree components inside ReSharper tool windows.
    • Elements inside the Options dialog.
    • Elements in the Alt+Enter menu.
    • All the Go To dialogs.
    • The code completion popup.

x:Bind support

  • ReSharper resolves x:Bind code correctly and offers several inspections and corresponding quick-fixes.
  • There is code completion and parameter info for propertyPath, BindBack, and UpdateSourceTrigger attributes inside an x:Bind expression.
  • Change Signature and Safe Delete refactorings are now aware of method usage in XAML code and update them accordingly.
  • Nullability awareness is integrated into the x:Bind code analysis. ReSharper now shows you null-related inspections directly inside the XAML code if there are CanBeNull and NotNull attributes in C# code.
  • Other ReSharper features like Find Usages and Go to Declaration are also aware of x:Bind bindings.

ReSharper Command Line Tools

  • In this release, ReSharper Command Line Tools run on Microsoft .NET Core on Microsoft Windows, Linux, and Apple macOS.
  • ReSharper Command Line Tools can be installed as a .NET Core global tool.

Type and Project Dependency Diagrams

  • In this release, the yFiles engine which is used to draw the graph has been updated to the latest version. This new yFiles version, in addition to our optimizations, significantly improves the performance of drawing the resulting graph.
  • Now it is possible to export the resulting graph to new formats:
    • GraphML file format for further analysis in external tools.
    • XPS file format for printing large diagrams that aren’t possible to export in PNG format.
  • The diagram tool window finally supports the Visual Studio dark theme.

Navigation updates

  • Navigating to usages of types from external assemblies in the code is now much easier. ReSharper can navigate straight from Go to Type search results to Find Usages.
  • Starting with v2020.2 release, several ReSharper actions can be called, such as calling quick documentation directly from the Go to Symbol and Go to File Member dialogs, using shortcuts mapped to these actions in your favorite keymap scheme.

New Peek actions

  • A set of new Peek actions have been added to show the result of some common ReSharper actions in a Peek Definition view.

Refactorings

  • In this release, the Conflicts dialog has been redesigned as a separate step in the Refactorings interface. The plain list from before has been replaced with a tree grouped by file.
  • When calling Introduce parameter or Introduce field refactorings on an expression, ReSharper asks which part of the expression the refactoring should be applied to.

Improved Unreal Engine features

  • ReSharper C++ 2020.2 introduces support for the Unreal Engine project model, bringing smarter auto-import suggestions for include directives and support for different solution configurations. ReSharper C++ also adheres more closely to the Unreal Engine guidelines by adjusting inspection severity and code generation actions.
  • For easier navigation, Search Everywhere/Go To now treats symbols from engine sources like library symbols. There are also several new inspections that enforce the Unreal Engine guidelines and remind you to refresh the project files in Unreal Editor.

Better C++/CLI support

  • Since the ReSharper license now covers both ReSharper and ReSharper C++ products, support for C++/CLI – a bridge between the languages – received lots of updates and improved interoperation between C++/CLI and C#.
  • ReSharper C++ will find derived symbols in C# code, while Go to Base Symbols and Go to Derived Symbols now work on imported CLR entities.
  • ReSharper C++ now inspects the way you allocate memory and suggests a quick-fix to replace gcnew with new (and vice versa) when the target type is not valid. Another inspection warns you when you try to use the C++ final specifier on a managed class or interface, with a quick-fix to make it sealed instead. Additionally, you can now use a quick-fix to convert a C-style cast to a safe_cast.

Assembly Explorer

  • NuGet v3 package feeds are now supported in Open from NuGet, Open from NuGet packages cache, and Open NuGet packages.config.
  • Items with similar names are now collapsed in the Open from NuGet and Open from NuGet packages cache dialogs.
  • NuGet packages are sorted alphabetically.

Formatting

  • ReSharper now aligns columns of similar code correctly, even when only part of the aligned group is being formatted, so adding a semicolon or a brace doesn't break the alignment anymore.