.NET Tools Releases ReSharper Platform

ReSharper 2023.2 EAP 7 Introduces a Predictive Debugger and Other Updates

It may seem like the Early Access Program for ReSharper 2023.2 reached its peak when we unveiled AI Assistant earlier this week. To anyone thinking that, we say, “Hold on! There are more surprises up ReSharper’s sleeve.”

The EAP 7 build has just been released, and it contains a couple of major new features, as well as smaller improvements. Let’s take a look!

Predictive debugger (Beta)

During regular debugging, once a breakpoint is hit, you are only able to observe the program’s current state. The problem is that executing a program causes side effects and state changes, which may require you to debug for all additional scenarios.

The predictive debugger mode we’re introducing in ReSharper 2023.2 is able to foresee all possible states triggered by executing a program without having to actually execute it, making it able to:

  • Show the expected values of the variables.
  • Visually “mute” parts of the program that will not be executed.
  • Warn you that further execution will end with an exception.

The predictive debugger will offer a new level of insight into your program’s execution. It will also enable you to experiment with different values and troubleshoot your code without having to restart the debugging process for each change.

You can enable the predictive debugger by going to ReSharper | Options | Debugger | Show predicted values (beta).

This debugger is currently in the Beta state, which means your feedback is crucial for it to reach its full potential. Please make sure to report any bugs you encounter to our issue tracker, along with any suggestions or requests you may have.

Navigating and Creating Unit Tests

ReSharper’s Unit Testing receives a major update as well. In EAP 7, we’ve merged a feature to navigate and create tests for your production code! To create a test, just invoke the Generate Code action, and choose Unit Test or hit Ctrl+U,C. ReSharper lets you choose the test class name and will even create a new project with your preferred testing framework (if it’s not already in place). Once the test is created, you can navigate between your implementation and test code from the Navigate To action or by hitting Ctrl+U,F.

By default, the navigation takes the affixes Test(s) and Spec(s) into account, but you can further tweak it under Tools | Unit Testing | Test Linker. You can also enable attribute-based and generic argument search that will link your tests, for instance via [Subject(typeof(Calculator))] or TestBase<Calculator>

C# updates

New interline hints for local functions

Earlier in this EAP cycle, we introduced an inspection with a quick-fix that puts an explicit return before local functions at the end of a method. Doing so helps readers understand that there’s no executable code after this point without having to scroll through all the helper methods.

The fix works great if you are willing to add such explicit exit points throughout your entire solution. But what if you are reading code that you don’t want to or aren’t allowed to change? For cases like this, ReSharper 2023.2 will display an inlay hint with return; or continue; statements before local functions to help you understand the code without changing it.

Improved support for #pragma warning directives

Pragma directives allow you to easily disable or restore compiler warnings by their IDs. However, while such IDs are a great way to communicate with the compiler, they might be hard for human developers to understand. Without encyclopedic knowledge, it may not be clear what an ID like CS0168 or CS0618 refers to or what requires attention. 

Starting with version 2023.2, ReSharper will display descriptive warnings as inlay hints after such pragma directives, unless there’s already a comment following one.

С++ updates

The EAP 7 builds for ReSharper and ReSharper C++ 2023.2 come with the following C++ language support improvements:

  • Import completion is now enabled by default in Visual Studio 2022.
  • Invoking Go to declaration on a module name now allows you to switch between export module and module.
  • The bundled clang-format binary has been updated.

Official GitHub Action for ReSharper

There is now an official InspectCode GitHub Action for the free command line version of ReSharper.

Other improvements

During debugging, Dynamic Program Analysis in ReSharper 2023.2 will disable the inspections tracking excessive database command duration times while the process is paused. This will eliminate the false issues triggered by these inspections caused by the debugger pausing the program’s run.

And that’s it! For the full list of changes, please refer to our issue tracker.

At this stage in the EAP cycle, your feedback is essential to us. Please share your thoughts on the latest updates by leaving a comment on this blog post or by getting in touch with us on Twitter.

image description