ReSharper 2023.2 offers improved support for C#, featuring new inspections for working with local functions, raw strings, and resolving common Entity Framework issues. This release also brings support for C++ refactoring and more C++20 and C++23 features. Among the features that make their debut in ReSharper 2023.2 is the ability to easily create and navigate through unit tests, predictive debugger mode, and the new AI Assistant.
Free 30-day trial available
ReSharper 2023.2 brings new code inspections and quick-fixes for working with raw string literals and local functions, as well as for handling common Entity Framework issues and redundant nullable directives. Early support for C# 12 covers primary constructors and lambda expressions with optional parameters. We've also improved ReSharper's support for discards and disposable resources and added new inline and interline hints.
ReSharper’s Unit Testing receives a major update with the addition of a feature that lets you 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 using the Navigate To action or by hitting Ctrl+U,F.
The 2023.2 versions of IntelliJ-based IDEs and .NET tools introduce a major new feature: AI Assistant. The initial set of AI-powered features offers an integrated AI chat and weaves naturally into some of the core development workflows via context actions, making it possible for AI Assistant to explain selected pieces of code, weed out potential issues, and generate XML documentation for you.
We added new C# inspections and context actions for working with raw strings, as well as improved typing assists and new formatting options:
Check out the corresponding blog post to learn more about our improved support of raw strings.
We added several new inspections, quick-fixes, and contextual navigation options for common problems you can experience working with databases using an object-relational mapping (ORM) framework like Entity Framework.
Read more about new Entity Framework-related inspections in the blog post.
ReSharper 2023.2 introduces two new inspections and corresponding quick-fixes aimed at improving code readability with local functions:
return
or continue
before local functions at the end of a method.
return
,
continue
, or another control flow jump statement.
For cases where you don't want to or aren’t allowed to change the code, ReSharper
2023.2 will display an interline hint with return;
or
continue;
statements before local functions to help you understand
the code without changing it.
Check out this blog post with more details about the new inspections.
#nullable
directives and NRT annotations
Several new inspections for #nullable
directives and NRT annotations
are now available:
JetBrains.Annotations
attributes on a base member.
To learn more about these inspections, please visit this blog post.
var
declarations
All navigation actions (Go to..., Find Usages, etc.) now suggest
underlying types when navigating from var
for common types used to
wrap other types. For example, ReSharper will suggest navigating to
Person
when using the Go to declaration action from the
var
keyword of a variable with the
ImmutableArray<Person>?
type.
You can learn more in the following blog post.
In the 2023.2 version, we introduced primary constructor support for non-record classes and structs from the C# 12 preview. There are several inspections that detect those types where the initialization can be expressed with new primary constructors and suggest applying a quick-fix to greatly reduce the amount of code repetitions.
Sometimes, the initialization of the type must be made less trivial and can no longer be expressed using a primary constructor. For such cases, we introduced a couple of context actions to reverse replacement from primary constructor parameters to constructors and ordinary fields.
To see all of these and much more features for primary constructors in action, check out the separate blog post.
As part of our work on supporting C# 12 language updates, we’re introducing support for default parameter values in lambda expressions. In addition to the standard set of warning messages associated with recognizing this syntax, we also tweaked an existing inspection, The parameter has the same default value, to account for default parameter values in lambdas. More information is available here.
ReSharper 2023.2 introduces two new code inspections designed to better control an object disposal:
We also improved the Generate dispose pattern feature to support the
IAsyncDisposable
interface and be able to generate an async
method to release the resources.
You can find more details for these additions here.
The code analysis received a bunch of new useful additions to C# discard support:
_
name is typically reserved for local parameters without usages
warning about variables and parameters named _
that are actually being used.
They look like a "discarded" value, but in reality, they represent very much
the opposite.
Check out the blog post to learn more about improved discard support.
When passing a value to a tuple argument or return type, C# allows you to skip
component names. However, without the names, it becomes more difficult to tell
the meaning of each component without looking at its target type. For example,
many software developers will have to check where a tuple (null
,
false
) is assigned to understand what its components mean.
That’s where inlay hints can help you out! ReSharper 2023.2 will display inlay hints with tuple component names when those names aren’t already apparent from the component expression, making your code much easier to read and understand at a glance.
For null and default components, ReSharper 2023.2 will display hints about their target types even if the target component doesn’t have an explicit name. It will make an exception for string and object types, as those usually aren’t very informative.
Another common situation in which names can improve readability is
deconstruction patterns where an explicit name is known either from the
Deconstruct
method or from source tuple components. These hints
were developed to provide you with additional context when a pattern itself
doesn’t contain enough data to understand what is matched, such as
value is ({ }, true, null)
.
#pragma warning
directives
Pragma directives allow you to disable or restore compiler warnings by their IDs
easily. However, while such IDs are a great way to communicate with the compiler,
they might be hard for human developers to understand. Without comprehensive
knowledge, it may not be clear what an ID like CS0168
or
CS0618
refers to or what
requires attention.
LINQ queries can often be complex, involving multiple transformations and projections. Debugging complex LINQ queries can be time-consuming, especially when dealing with large data sets. To help you easily inspect the output at each step of the query, ReSharper will now display intermediate results as inlay hints during debugging.
With editor adornments showing intermediate results, you should now be able to quickly identify if there are any unexpected values or incorrect transformations happening along the way.
ReSharper C++ introduces the Safe Delete refactoring to let you remove symbols from the source code safely. This refactoring is available for classes, functions, variables, enumerators, namespaces, and even concepts.
Before deleting a symbol, ReSharper C++ searches for its usages and lets you preview the changes to the source code, so you can be sure that all the removals are intended. For example, if you try to delete a complex entity like a class or a namespace, ReSharper C++ will recursively check the usages for all its members.
This release brings support for several new language features, including
if consteval
, C++23 standard library modules,
[[no_unique_address]]
attribute, and static
operator()/operator[]
.
ReSharper 2023.2 introduces a couple of new options for C# code formatting, designed to improve the readability of chained method calls.
The first code formatting option controls whether a line break comes before the first method call. The second option is for situations where method and property invocations are mixed, and it determines whether a line break should be inserted after the property invocation.
AI Assistant is not bundled with ReSharper and must be installed separately. For the time being, there’s a waiting list for access to the AI Assistant feature.
Learn more about AI Assistant and how to install it via the Toolbox App or dotUltimate installer in our webhelp.
By default, AI Assistant inside ReSharper is aware of your development environment: the programming languages, frameworks, libraries, and technologies used in the solution. This awareness allows the AI to generate more accurate and specific responses to your queries.
The Smart chat option enables AI Assistant to reference specific files and symbols, retrieve code fragments or the latest changes, and look for usages of particular methods. As a result, it can offer even more accurate suggestions.
With the AI Assistant plugin installed, ReSharper’s context actions will offer a number of AI-powered options. AI Assistant can help you:
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:
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 | Tools | Debugger | Editor Integration | Predictive 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.
ReSharper 2023.2 provides a way to make a detailed comparison between two assemblies. This feature is especially useful when scrutinizing the differences between two versions of a specific assembly and searching for potential vulnerabilities that may have been introduced in a newer version.
To compare assemblies, click Compare Two Assemblies in the
Assembly Explorer tool window. Both single-file applications and
.exe
or .dll
files can be selected for comparison.
Click here to learn more about the feature.
With ReSharper 2023.2, we’ve revised our approach to caching the data required by the IDE to make its systems work. This revision, supported by myriad performance tests, resulted in a noticeable reduction in disk space consumption for each solution you open. In practical terms, it means overall less time spent doing disk input/output and faster loading times for solutions.
Another change that led to improved solution loading speed was the refactoring of ReSharper’s internal component construction logic. Click here to learn more.
Free 30-day trial available