Dotnet logo

.NET Tools

Essential productivity kit for .NET and game developers

.NET Tools News Releases ReSharper Platform

ReSharper 2023.1 Comes With Enhanced C# Support, Exciting Updates for C++, and More!

Hello everyone,

ReSharper 2023.1 and new versions of other JetBrains .NET tools have just been released. In this article, we’ll cover the highlights of this major update for ReSharper and touch on the features coming to ReSharper C++. 

To learn more about our other .NET tools, including dotCover, dotMemory, dotPeek, and dotTrace, please check out this separate blog post.

Let’s dive in!

C# support

Reducing the number of lookups in collections

ReSharper 2023.1 introduces a set of inspections with corresponding quick-fixes to optimize and speed up your work with different types of collections by reducing the number of lookups inside them. 
For example, ReSharper will now suggest removing redundant Contains and ContainsKey checks or using TryAdd and TryGetValue methods instead.

To remove a Contains(item) check before adding the item into HashSet or other collections implementing the ISet interface To use TryAdd(key, value) for Dictionary collections or collections inherited from Dictionary when possible

Syntax style for null checking pattern

A new Syntax style setting was added to ReSharper 2023.1 to help you maintain a consistent style of not null checks inside patterns. The setting consists of 2 options: empty recursive pattern syntax { } and negated pattern not null, where the latter is the default. 

However, using the not null pattern may hinder your ability to introduce variable names for checked values. To address this, we’ve added the Add pattern variable context action over the not null pattern. This looks for expressions accessing the same value (since we’re introducing a variable name) and replaces all of them with the newly introduced name to consolidate all of the accesses to the same value.

For the full list of improvements to the support for C#, check out the What’s new in ReSharper 2023.1 page. 

Learn even more about support for C#11 features in ReSharper and Rider in these blog posts:

C++ support

Call tracking

ReSharper’s Call tracking has finally come to ReSharper C++! You can now view and navigate through call chains in the hierarchy of incoming calls. Just place the caret at any function and select Inspect | Incoming calls from the context menu or press Ctrl+Shift+Alt+A to invoke it from the Inspect This menu.

In the call tracking results window, you can double-click on the hierarchy entry to navigate to the corresponding call in the editor, or expand any node to check out its incoming calls. Tracking outgoing calls is currently not supported.

Macro substitution preview

When hovering over a macro, you can now see the macro expansion in the tooltip with full syntax highlighting and proper code formatting. You can still use the Substitute macro call context action to check out the macro expansion right in the code, but the instant preview makes working with macros easier. 

For more details on C++ support in ReSharper, see this dedicated blog post.

UX/UI improvements

At the beginning of the year, we shared our plans for overhauling shortcuts and starting the massive work on ReSharper’s UX and UI. Those plans are well underway and ReSharper 2023.1 showcases the first 2 improvements on this front. 

The first is the new dialog that will help users set up their preferred keyboard shortcut scheme when they first launch ReSharper. The other is a reworked update dialog that contains notes on the changes made to the latest available build, so you can make a more informed decision on whether you’d like to download or skip the update.

Plugin migration

ReSharper’s feature set is not limited to what it offers on its own, as it is also a platform for dozens of intelligent plugins. If you rely on those extensions, we’ve improved the way plugins migrate from one version of ReSharper to another. 

Starting with ReSharper 2023.1, a built-in API verifier will check the installed plugins for binary compatibility and migrate the viable ones. Plugin authors will also receive automatic notifications via JetBrains Marketplace whenever the APIs used by their plugins are no longer present in the SDK.

Other updates

  • With ReSharper 2023.1, whenever you rename a file inside your solution, a dialog will appear with the option to rename all relevant symbols (classes, interfaces, etc.) to match the change.
  • Text search filters applied to unit test trees are now taken into account when running tests using the Run buttons in the toolbar. Only the nodes that satisfy the search criteria will remain listed and be run.
  • With little demand for CSS in ReSharper, we found it increasingly hard to prioritize keeping up with the latest versions of the language. Starting with ReSharper 2023.1, CSS support has been put on hold and will be disabled by default. 
  • As of the 2023.1 release, we’re dropping support for the 2 oldest versions of Visual Studio: Visual Studio 2010 and Visual Studio 2012. 

For the full list of changes and improvements, be sure to check out the What’s new in ReSharper 2023.1 page.

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

image description