ReSharper C++
The Visual Studio Extension for C++ Development
ReSharper C++ 2023.2: Safe Delete Refactoring, AI Assistant, New C++23 and C++20 Features
ReSharper C++ 2023.2 is now available for download!
It brings support for several new C++20 and C++23 features, as well as Safe Delete refactoring to let you safely remove symbols from the source code. This version also introduces a separate AI Assistant plugin specifically designed to help you with programming tasks. Read on for details about all of this version’s key improvements.
Update to this version, or start a free 30-day trial today! The brand-new build is available on our website, and all our tools for Visual Studio can be downloaded via the Toolbox App.
AI Assistant [Beta]
ReSharper C++ 2023.2 brings in ReSharper’s AI Assistant – an AI-driven feature specifically designed to answer programming questions and help you with troubleshooting, refactoring, documenting, and other development workflows.
Feel free to include parts of the source code in your queries. ReSharper will detect the code you sent or pasted into the chat and properly format it, while the AI model will explain the logic behind the code and help you refactor, find issues, or document it.
ReSharper’s AI Assistant takes into consideration the language and technologies used in your project. This context awareness tailors its responses right out of the gate, saving you time and effort. Learn more in our webhelp.
Safe Delete refactoring
ReSharper C++ introduces the Safe Delete refactoring to let you remove symbols from your 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. 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.
To invoke the refactoring, place the caret on the symbol you want to delete and press Alt+Del
, or select Safe Delete from the Refactor This menu.
C++23 support
If you have already started using C++23 features or considered checking out whether there is something interesting for your project, ReSharper C++ now supports a bunch of new language features:
- The
if consteval
statement is a new addition for constant evaluation: If the evaluation of theif consteval
statement occurs during a constant evaluation, then the following compound statement is executed. Otherwise, theelse
branch is executed (P1938). This release also brings a set of related inspections.
- With C++23 standard library named modules, you can use
import std
orimport std.compat
to import the entire standard library instead of using a precompiled header or including specificstd
headers (P2465). - Before C++23, all operators had to be non-static member functions. C++23 allows both
operator()
andoperator[]
to be static (P2589).
C++20 support
We’ve been working hard on polishing the support for C++20 modules, fixing various corner issues in real-world projects that use them. When processing modules internally, ReSharper C++ now implements the discarding of declarations that are not decl-reachable, significantly improving performance for modules that include a lot of headers in the global module fragment. In addition, we implemented several changes to better support modules in CMake projects. ReSharper C++ now recognizes .cppm
files as module interfaces and includes experimental support for modules located outside of the project folder.
Among other updates for C++20, ReSharper C++ 2023.2 includes support for the following language features:
- New
[[no_unique_address]]
attribute indicates that a unique address is not required for a non-static data member of a class, allowing the compiler to lay out members of the class in a more efficient way (P0840). - Recently accepted C++20 defect report allows the initialization of a
char
orunsigned char
array with a UTF-8 string literal (P2513).
Unreal Engine
This release brings performance improvements for indexing Blueprints. The first time you open a project, ReSharper C++ indexes all of your Blueprint assets to power features like Find Usages and show the values of serialized data directly in the text editor.
Previously, ReSharper C++ would index these assets with the same priority level as your C++ code. This meant that it took longer for the project to be ready for work. ReSharper C++ 2023.2 will index assets in the background after indexing your C++ code without interfering with your work.
We’ve improved smart completion for wrapper types with standard assignment semantics. For example, when assigning to a variable of the TEnumAsByte
type, completion will suggest enumerators from the underlying enumeration type. We’ve also introduced support for the Unreal Engine 5.1 UE_INLINE_GENERATED_CPP_BY_NAME
macro, which lets you inline generated files into your module to improve compilation time.
Code analysis
Here are some of the new inspections available in ReSharper C++ 2023.2:
- Redundant dereferencing and taking address:
- Redundant template arguments.
- ISO C++ forbids forward enum declarations without underlying type.
ReSharper C++ now highlights the #error
and #warning
diagnostic preprocessor directives according to their severity level.
We’ve also supported the /Zc:preprocessor
compiler argument and updated the bundled Clang-Tidy to Clang 16, adding new checks from the latest LLVM release.
Go to Declaration updates
ReSharper C++ 2023.2 brings several improvements to Go to Declaration for more consistent and straightforward code navigation without extra steps:
- When invoked on a class name in a constructor call, Go to Declaration now navigates to the constructor instead of the containing class:
- Go to Declaration now navigates to the first
typedef
or type alias declaration instead of showing the menu with all declarations. - Go to Declaration on a module name jumps between interface and implementation units for the same module.
- Go to Declaration on a folder in an
#include
path opens the folder.
Additionally, Type of symbol is now available on non-declarator symbols. The way it works there is similar to Go to Declaration.
Coding assistance
With improved completion for dependent code, you will now get completion items when the type is restricted by a concept or a trait. ReSharper C++ now considers the standard std::is_same
/std::is_base_of
type traits, their _v
value aliases, the corresponding std::same_as
/std::derived_from
concepts, and the Unreal Engine TIsSame
trait.
For more helpful code completion suggestions, ReSharper C++ now also extracts type and value requirements from requires
-clauses, if constexpr
, and SFINAE.
Other notable improvements include:
- There are new context actions to help you move a template parameter constraint to the
requires
-clause and convert arequires
-clause to a template parameter constraint. - If you have a recursive call, ReSharper C++ will mark it in the gutter.
- The code completion list now filters out reserved identifiers and suggests them only after “
_
”. - Proper highlighting and formatting for macro substitution now also work for macro definitions and Parameter Info in code completion.
- The evaluation engine now supports aggregate initialization of
constexpr
arrays. - ReSharper C++ is now more compatible with GCC and Clang compilers and libc++/libstdc++ standard libraries, bringing support for built-ins, like
__integer_pack
and__is_convertible
/__is_nothrow_convertible
, as well as updates for the previously supported ones. - When you specify the parameter direction with the
[in]
,[in,out]
, or[out]
attribute of the Doxygenparam
command, the tooltips now fetch them from your comment.
Formatting and typing assistance
When generating documentation comments, ReSharper C++ will now adjust the documentation template according to the comment style from the editor.
For /**
, typing assistance will generate the comment in the /** */
style, and for ///
, the comment will be in the ///
style.
This release also brings several improvements to the formatting of bit-field members and updates the bundled clang-format binary.
These are all the highlights for today!
The full list of fixed issues is available in our issue tracker. You can also check out the latest updates in ReSharper to learn about other enhancements, such as a predictive debugger that foresees all possible states that could be triggered by a program without having to actually execute it.
We’re always keen to receive your feedback about new features and updates, so please give ReSharper C++ 2023.2 a try and let us know what you think.
Your ReSharper C++ team
JetBrains
The Drive to Develop