ReSharper C++
The Visual Studio Extension for C++ Development
ReSharper C++ 2024.1: Slate UI Framework and Better Support for C++20 Modules
We’ve just released ReSharper C++ 2024.1!
This latest version brings improved support for C++20 modules and implements outgoing calls in Call Tracking. Coding assistance changes include enhancements for Change Signature, updated documentation comment functionality, and more. For Unreal Engine developers, ReSharper C++ 2024.1 includes support for the Slate UI framework and asset path completion in C++ code.
Read on for details about all of this version’s key improvements.
Update or start a free 30-day trial today! The brand-new build is available on our website, and all of our tools for Visual Studio can be downloaded via the Toolbox App.
Game development with Unreal Engine
ReSharper C++ is tuned to help developers create glitch-free games with Unreal Engine faster.
ReSharper C++ 2024.1 introduces support for Unreal Engine’s Slate UI framework. The Unreal Editor interface is largely built using Slate. It’s designed to make building user interfaces for tools and applications more efficient.
You can rely on ReSharper’s code formatter and typing assistance to format your Slate code according to Unreal Engine’s conventions. Features, like Go to declaration, Find Usages, and Rename, have also been updated to understand Slate’s declarative syntax.
Other enhancements for game developers include:
- Blueprints:
- ReSharper C++ now adds core redirects when renaming a UENUM instance.
- Code completion now works for asset paths for resource names in C++ code.
- HLSL interfaces used for the dynamic shader linkages are now supported in shader code.
- C files in Unreal Engine projects are now handled correctly by ReSharper C++ as C, not C++, files.
If you’re interested in a stand-alone cross-platform IDE for Unreal Engine development, consider Rider. Unreal Engine support in Rider and ReSharper C++ is aligned, and you can expect the same improvements in the Rider 2024.1 update.
C++ language support
C++20 modules support
Are you using C++20 modules in your projects or considering starting with them? As per the results of our Developer Ecosystem 2023 research, half of respondents plan to use C++20 modules in the next 12 months.
As one of the major improvements in this new version, we expect a significant reduction in the footprint of exported modules. To achieve this, we reworked the internal representation of exported C++20 modules to facilitate transitive references to entities imported from other modules. ReSharper C++ no longer reexports these entities from the module that imported them, which leads to reduced memory consumption.
ReSharper C++ now supports internal partition units, which are module partition units that do not contribute to the external interface of a module. In other words, they are module partitions without an associated export module declaration.
Better support for built-in functions
More accurate handling for built-in functions like __builtin_bit_cast
, __builtin_choose_expr
, __builtin_types_compatible_p
, and __builtin_strlen
was implemented.
C++ coding assistance
Outgoing calls in Call Tracking
Call Tracking enables you to view and navigate through call chains in your code. v2024.1 now supports navigation through outgoing C++ call chains, in addition to the existing support for tracking incoming calls. To explore outgoing calls, place the caret at any function and select Inspect | Outgoing calls from the context menu. Alternatively, you can press Ctrl+Shift+Alt+A to invoke it from the Inspect This menu.
Change Signature improvements
The Change Signature refactoring allows you to make one or more modifications to the signature of a function. All usages, implementations, and overrides of the function will be updated accordingly. As one of the most valuable and game-changing refactorings, it has gone through a major overhaul in this release:
- Now you can use the Change Signature refactoring to change the type of a function parameter between a pointer, a reference, or a value type. All usages and function arguments at the function call sites will be updated for you by ReSharper C++.
- If you want a value to be used as the default for the new function parameter, you can do so in the Change Signature dialog via Set as the default value in the parameter declaration option.
- If you are refactoring the function used in the dependent code, ReShaper C++ now lets you verify the changes and confirm which usages need to be updated.
- Change Signature now preserves array types and the int type specifier in unsigned int types.
- The refactoring now correctly updates function arguments for call sites inside macro calls.
- When updating function parameters described in doxygen comments, Change Signature now also updates doxygen parameter descriptions:
- The refactoring now handles variadic function templates correctly.
- The refactoring now supports specifying noexcept for functions with dynamic exception specification.
Regarding refactorings, ReSharper C++ continues to outperform other tools by passing more test cases according to the latest results from the extensive test suite for C++ refactoring tools maintained by Richard Thomson. Hooray! As a part of our constant work to improve the quality of ReSharper’s suggestions, we’ve addressed several issues identified by Richard’s test suite in ReSharper C++ 2024.1.
Code analysis update
ReSharper’s code analyzer works as you type and help you catch potential issues and guideline violations faster:
- ReSharper C++ 2024.1 now suggests removing redundant idiomatic zero initializers in aggregate initialization.
- A new inspection was added to catch redundant inline specifiers on static constexpr data members.
- Apply ‘auto’ style now handles global variables and class members in addition to local variables.
- Support in the code analyzer for the attributes [[maybe_unused]] and [[has_side_effects]] was improved.
If you want to suppress an inspection in a specific scope, previously, you could use ReSharper-specific // ReSharper disable comments. ReSharper C++ 2024.1 additionally recognizes the NOLINT, NOLINTNEXTLINE, and NOLINTBEGIN … NOLINTEND comments that clang-tidy uses.
Code formatting update
- ReSharper C++ 2024.1 introduces several new formatting options:
- Break line after goto labels and Indent goto labels enhance the formatting of labeled statements.
- Settings that control wrapping inside enumerations under Arrangement of enumerations.
- Empty braces formatting now includes the Do not change option.
- When using a .clang-format config, ReSharper’s formatter now respects the DisableFormat and IndentAccessModifiers settings.
- The GNU built-in clang-format style is now supported.
Code documentation
ReSharper C++ can generate comments for Doxygen-style documentation in your code. The specific style of this comment, for example, the presence of the @brief tag or the style of the parameter description, can now be configured in the default template settings in Settings | Code editing | C++ | Code generation.
JetBrains Grazie was introduced in ReSharper 2023.3 for built-in grammar and spelling checks. In the 2024.1 release, Grazie-powered grammar inspections are also available inside C++ documentation comments.
Are you interested in the latest changes introduced to ReSharper in this release? Check out our blog post.
Your feedback is highly appreciated and plays a crucial role in improving the product. We encourage you to share your thoughts and suggestions regarding the new features and updates. If you spot a bug, please report it to our issue tracker.
Your ReSharper C++ team
JetBrains
The Drive to Develop