ReSharper C++ 2020.3 takes another step toward full C++20 support by implementing the C++20 comparison rules and adding new inspections to help you adopt the C++20 ranges library. Push-to-Hint inlay hints and new navigation features are here to make your day-to-day development more enjoyable. Unreal Engine developers can take advantage of the editor integration with UnrealHeaderTool, an improved project model, and new inspections based on control-flow analysis in HLSL shader files.
Free 30-day trial
ReSharper C++ 2020.3 provides seamless integration with UnrealHeaderTool to help you catch more issues with Unreal Engine class metadata right in the editor. When working with an Unreal Engine project, ReSharper C++ automatically runs UnrealHeaderTool on the file you’re editing and displays any errors or warnings, just like with other inspections. Watch the UnrealHeaderTool integration in action.
To always keep you up to date, ReSharper C++ now tracks Unreal Engine properties in real time and regenerates the project model as soon as you save any changes in .Build.cs, .Target.cs, .uproject, or .uplugin files.
ReSharper C++ 2020.3 improves its conformance to the Unreal Engine coding standard. For example,
ReSharper C++ now suggests using MoveTemp
(Unreal Engine's equivalent of std::move
) for casting to an rvalue reference.
ReSharper C++ 2020.3 fully supports C++20 comparison rules. This includes a significant change to how comparisons work, where the language is allowed to rewrite a comparison expression or reverse the order of arguments. You can now consult the tooltip to learn how an expression has been rewritten. When a comparison operator cannot be resolved, the error message will list all the considered overloading candidates.
Defaulted comparison operators are another addition to C++20. If you are not sure why a defaulted comparison operator in your class has been implicitly deleted, you can check the detailed tooltip message to find out the exact reason. ReSharper C++ can now also deduce the return type of a defaulted three-way comparison operator.
A new quick-fix lets you quickly add an #include <compare>
directive to
your source file, which is required whenever you use a three-way comparison operator that
returns a standard comparison category, such as std::strong_ordering
.
The Create operator from usage quick-fix has been updated to support C++20 comparison rules as well. You can now create both the member and the friend versions of an operator in addition to the non-member version. For secondary operators, which can be rewritten in terms of a primary one, you can choose to create either the primary or the secondary operator.
The full power of ReSharper's control-flow analysis now comes to HLSL shader files, including warnings about unreachable code, uninitialized variables, redundant control flow jumps and conditional branches, and much more.
ReSharper C++ 2020.3 offers two inspections with quick-fixes to help you adopt the new C++20 ranges library and modernize your code:
std::views::keys
/values
can be used.A new inspection suggests replacing usages of standard algorithms that accept a pair of iterators with equivalent algorithms that accept an iterator and a count where possible.
The bundled Clang-Tidy binary has been updated to Clang 11, adding new checks and compiler diagnostics from the latest LLVM release.
ReSharper C++ provides many kinds of inlay hints. While all of the hints are useful in certain scenarios, we’ve also heard feedback that sometimes they can be overwhelming. To help address this, we’ve come up with a new "Push-to-Hint" mechanism for inlay hints. In the Push-to-Hint visibility mode, hints are only shown when you either press and hold Ctrl, or press Ctrl twice.
We've made sure that the visibility mode can be configured separately for every kind of C++ inlay hint. You can quickly change the visibility mode for a given hint using the context menu, or head to the new option pages under Environment | Inlay Hints | C++ to check out all the settings.
A new context action helps you invert ternary operator expressions.
The "Join declaration and assignment" quick-fix is now available for cases when a local variable is reassigned in all paths before being read.
With import completion enabled, the completion list will suggest suitable members of incomplete classes from the header files that are not included in the current file.
Import completion now also suggests a new option to add an elaborated type specifier for the corresponding class, in addition to the options to add an include directive or a forward declaration.
We've improved argument code completion for library functions that accept macro constants. Library macro constants that are applicable to the current argument are now prioritized in the completion list. This heuristic works for functions from the standard library, WinAPI, and OpenGL.
In addition to its regular search, Find Text now performs a fuzzy search, which
means it takes possible typos and missing words into account. This feature can be very
helpful if you are looking for a certain format string used as an argument to a text
formatting function like printf
or std::format
.
You can now use Go to Declaration to jump between matching preprocessor directives,
such as branches of a conditional preprocessing block, or the
#define
and #undef
of the same macro in a single file.
Go to Declaration can also be used to quickly navigate to a base function – just
invoke it on an override
keyword.
Peek Implementations and Peek Base Symbols come to C++, allowing you to view and edit code in a popup window without switching away from the code you're writing.
For better readability, File Structure now uses the C++17 syntax for nested namespaces even if you have not yet adopted the new syntax in your codebase.
Go to Derived Symbols works for get
/set
functions inside
C++/CLI properties and for
add
/remove
functions inside C++/CLI events.
<coroutine>
header.
Take a look at What's New in ReSharper to learn about other changes coming to the ReSharper platform. For example, command-line tools now support plugins, and you can invoke CleanupCode on a specific set of files or folders instead of the whole solution.
Free 30-day trial
To increase the accuracy of auto-import and code completion, ReSharper C++ 2020.2 introduces support for the Unreal Engine project model. This means that ReSharper C++ is now able to read project information directly from .uproject files, without using the intermediary project files generated by Visual Studio. The new project model provides more refined lists of suggested items that depend on the plugin and module references. ReSharper C++ will also adjust its behavior when you switch the solution configuration.
ReSharper C++ will now also remind you to refresh your Visual Studio project in Unreal Editor if the project files are out of date.
For easier navigation, symbols from engine sources are now treated as library symbols and will be hidden by default from the search results if there is a matching symbol in user code.
To match the
Unreal Engine coding standard, ReSharper C++ 2020.2 includes several updates to
inspection severity, code generation actions, and auto-import of include
directives.
Also, a new inspection with a quick-fix is
available for adding the virtual
specifier to overriding functions.
ReSharper C++ 2020.2 includes a lot of bug fixes and brings improved interoperation of C++/CLI with C#. When looking for derived symbols in C++/CLI code, ReSharper C++ finds symbols in C# code in addition to symbols in C++/CLI. Navigation to base and derived symbols also works on imported CLR entities.
New code inspections with quick-fixes are available for the gcnew
,
sealed
, and safe_cast
usages.
The following features have had their their scope and applicability extended:
ReSharper C++ can now automatically highlight usages of the element under the caret as you move through your code.
In the File Structure window, preprocessor directives are now hidden by default so you can navigate through large files more easily.
New inspections are available with corresponding quick-fixes that help you with the following cases:
virtual
specifier.gcnew
on a native type and cannot use new on a managed type.
final
specifier cannot be used for managed classes.ReSharper C++ now also highlights spelling mistakes for preprocessor directives.
With a brief preview of Clang-Tidy quick-fixes, it's now easier to select the required fix option.
The evaluation engine has been updated with support for the modification of values inside
constexpr
functions and can work with the values of class types.
A new completion item can insert an auto-generated lambda argument when a
std::function
parameter is expected.
If a class is not included in the current file, import completion will suggest a new option to add a forward declaration instead of including the corresponding header file.
ReSharper C++ 2020.2 adds three new settings for more flexible configuration:
?:
operator – a formatting option for multiline ternary
expression.
//
on Enter in multi-line // comments – an editor option
to prevent the auto-extension of multi-line comments in single-line style.
The #include
ordering settings have been moved to a separate options page and are now
easier to find – just click Order of #includes under the Code Editing | C++
option group.
Last but not least, the formatting engine now works significantly faster in source files with many macro calls.
There are more updates from ReSharper itself. For example, code cleanup can now be launched automatically on save or applied only to the changed parts of recently modified files. You can learn more about these improvements here.
The C++20 standard has almost been signed off on, and ReSharper C++ introduces support for one more set of its features.
ReSharper C++ 2020.1 adds support for using enum declarations, which let you bring specific enumerators from a scoped enumeration into the local scope. A new refactoring, Introduce Using Enum, is available to help you add using enum declarations to existing code.
For C++20's Concepts, ReSharper C++ supports the new syntax for constrained type placeholders and abbreviated function templates. Improved error messages about unsatisfied constraints help you understand what went wrong during template substitution.
ReSharper C++ also suggests a quick-fix for using template syntax for lambdas when doing so helps you avoid errors or unify your use of lambdas and functions.
ReSharper C++ 2020.1 improves the Rename refactoring in Unreal Engine projects. Now it updates the corresponding
*.generated.h
include directive and related files with the A
,
F
, E
, T
, S
, and U
prefixes.
When ReSharper C++ detects an Unreal Engine project, it tweaks the default settings to stop suggesting Use auto to better align with the Unreal Engine guidelines. Also, ReSharper C++ 2020.1 includes updated naming rules for console variables and log categories. You can now navigate to namespaces that contain an enumeration in the Unreal Engine style from Search Everywhere/Go to.
Finally, ReSharper C++ now also supports USF files with virtual file paths and SpatialOS GDK. Learn more.
ReSharper C++ 2020.1 now provides initial support for HLSL, the High-Level Shading Language. ReSharper C++ highlights HLSL code according to your default color scheme and displays inlay hints and tooltips for code elements with type information and documentation. You can also search for and quickly navigate to structs, functions, or parameters in your entire solution, referenced files, and standard libraries. And to perfect the HLSL experience, ReSharper C++ offers you smart code completion, auto-inserting matching delimiters, and more.
Several new inspections are available for the following issues, with corresponding quick-fixes that help you resolve them:
reinterpret_cast
used instead of a
static_cast
when casting to void*
.Two more features help you adopt the C++17 maybe_unused attribute:
[[maybe_unused]]
to an unused parameter or variable.UNREFERENCED_PARAMETER
and
Q_UNUSED
annotations with [[maybe_unused]]
.The bundled Clang-Tidy binary has been updated to Clang 10, adding more than 70 new checks and compiler diagnostics from the latest LLVM release.
The completion list now suggests label names, standard C++ attributes, the new
std::forward
postfix template, and arguments for calls to a base function. Additionally, ReSharper C++ now provides code completion in macro bodies.
Two well-known features from ReSharper for .NET have finally come to ReSharper C++:
With improved typing assistance, you can now select any piece of code and type a parenthesis, brace, bracket, or quote to surround the selection with the corresponding characters. The code readability helpers – parameter name hints and type hints – are now available in dependent code.
The new Document edit action, bound to Ctrl+/ by default, lets you quickly generate a documentation comment for the nearby code element instead of using the context action.
ReSharper C++ 2020.1 introduces two new refactorings to help you upgrade your enum usage:
using enum
declaration and shortens enumerator references to make your code easier to read.Code navigation features have been extended to be even handier:
In the File Structure window, the icons now have indicators for class member accessibility, inheritance, and virtual/static/pure specifiers.
ReSharper C++ 2019.3 allowed you to sort
#include
directives, rearrange existing groups, and create new ones separated by blank lines. ReSharper C++ 2020.1 adds two new settings to make this action even more configurable:
And it's now possible to import the sorting settings from a
.clang-format
file if Read code style from .clang-format style is checked on the ReSharper | Options | Code Editing | General Formatter Settings page.
ReSharper C++ 2020.1 comes with several other noteworthy changes:
[[nodiscard]]
attribute.
MOCK_METHOD
macro introduced in GTest 1.10.
Also, more changes are coming from ReSharper itself. For example, unit test sessions can now be exported and imported.