ReSharper 2023.2

Improves support for C#, featuring new inspections for working with local functions and raw strings.
August 3, 2023
New Version

Features

Key updates

  • Improved C# support - This release brings new code inspections and quick-fixes for working with raw string literals and local functions, as well as for handling common Microsoft Entity Framework issues and redundant nullable directives. Early support for C# 12 covers primary constructors and lambda expressions with optional parameters. ReSharper's support for discards and disposable resources has also been improved and new inline and interline hints have been added.
  • Navigating and Creating Unit Tests - ReSharper's Unit Testing has received a major update with the addition of a feature that lets you navigate and create tests for your production code.
  • AI Assistant [Limited access] - With the initial set of AI-powered features, AI Assistant offers an integrated AI chat and weaves naturally into some of the core IDE user 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.

C# support

  • Improved support for raw strings - Added new C# inspections and context actions for working with raw strings, as well as improved typing assists and new formatting options:
    • A Use raw string inspection to transform multi-line verbatim strings into their raw representations.
    • A Simplify raw string inspection to remove some of the quotes and dollar sign symbols that become redundant.
    • A number of context actions to add or remove quotes, interpolation braces, and dollar sign symbols and to switch between single-line and multi-line representation.
    • Several code formatter options, allowing you to align or indent the content inside raw strings.
    • Improved typing assistance on clicking the Enter, Delete, or Backspace keys.
  • Inspections for common Entity Framework issues - 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.
  • Inspections for working with local functions - This release introduces two new inspections and corresponding quick-fixes aimed at improving code readability with local functions.
  • Inspections for #nullable directives and NRT annotations - Several new inspections for #nullable directives and NRT annotations are now available.
  • Improved navigation from 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.
  • Primary constructors [C# 12 preview] - Introduced primary constructor support for non-record classes and structs from the C# 12 preview.
  • Support for default parameter values in lambdas [C# 12 preview] - Introduced support for default parameter values in lambda expressions. In addition to the standard set of warning messages associated with recognizing this syntax, an existing inspection has also been tweaked, the parameter has the same default value, to account for default parameter values in lambdas.
  • Better support for disposable resources
    • This release introduces two new code inspections designed to better control an object disposal:
      • The Return of a variable captured by 'using' statement inspection alerts you when the returned object is immediately disposed of.
      • The Return of a task produced by 'using'-captured object inspection identifies scenarios where a Task is produced by an object captured by a using statement and then immediately returned.
    • The Generate dispose pattern feature has also been improved to support the IAsyncDisposable interface and be able to generate an async method to release the resources.
  • Better C# discard support - The code analysis received a bunch of new useful additions to C# discard support:
    • You can now quickly check the names and types of discarded values with the Push-to-Hint functionality.
    • A The _ name is typically reserved for local parameters without usages warning about variables and parameters named _ that are actually being used.
    • A Use discard assignment inspection is available to replace an unused variable and parameter with a discard.

Inlay hints

  • Inlay hints with tuple component names
    • 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. ReSharper will now display inlay hints with tuple component names when those names aren't already apparent from the component expression.
    • For null and default components, ReSharper will now display hints about their target types even if the target component doesn't have an explicit name.
  • Improved support for #pragma warning directives - Pragma directives now allow you to disable or restore compiler warnings by their IDs.
  • Adornments for LINQ - 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.

C++ support

  • Safe Delete - 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.
  • More C++20 and C++23 features - 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[].

Code formatting

  • Formatting fluent API calls - This release 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 [Limited access]

  • 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.
    • Chat with AI Assistant - 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.
    • Context actions - With the AI Assistant plugin installed, ReSharper's context actions will offer a number of AI-powered options. AI Assistant can help you:
      • Explain selected code.
      • Identify potential issues.
      • Come up with code for unimplemented methods.
      • Generate XML documentation.

Predictive Debugger [Beta]

  • The predictive debugger mode that has been introduced in this release 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 in cases where 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.

Decompiler

  • Assembly diff - This release adds a way to compare two assemblies in detail. 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.

Performance

  • With this release the approach to caching the data required by the IDE to make its systems work has been revised.
  • Improved solution loading speed by refactoring ReSharper's internal component construction logic.

Miscellaneous

  • Dynamic Program Analysis - DPA would previously highlight large blocks of code if the corresponding call stack contained memory allocations by lambda functions. Highlighting is now more granular.
ReSharper

ReSharper

Increase your .NET productivity.

Got a Question?

Live Chat with our JetBrains licensing specialists now.