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
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_castused instead of a
static_castwhen casting to
Two more features help you adopt the C++17 maybe_unused attribute:
[[maybe_unused]]to an unused parameter or variable.
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 enumdeclaration 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:
MOCK_METHODmacro introduced in GTest 1.10.
Also, more changes are coming from ReSharper itself. For example, unit test sessions can now be exported and imported.
Free 30-day trial
C++20 is feature-complete and will be officially signed off next year to provide C++ developers with a range of long-awaited goodies. ReSharper C++ 2019.3 already supports many of these features, augmenting them with additional analysis and insights.
Not only are concepts supported in ReSharper C++’s parser, but Rename refactoring and Find Usages are also available. Even better, code analysis can show you more details about errors related to Concepts. For example, if the overload resolution fails because a Concept’s requirement is not satisfied, you’ll see all the details in a tooltip. By the way, in ReSharper 2019.3 we’ve also added color to the tooltip that shows the details on the overloading resolution failures.
We’ve started a series of C++20 and ReSharper C++ blog posts, which you can use to learn about the new language features and their adoption in ReSharper C++.
If you find a Clang warning too distracting, you can now disable it from the inspection menu. And for all code checks, you can now suppress the corresponding inspection for all such issues in the file – simply use Disable in file with comment, or even suppress all inspections in the file with Disable all inspections in file with comment.
As you type a lambda body, a new quick-fix will assist you with adding variables to the lambda capture list. No need to do it manually – just place the caret on a variable in the lambda body and press Alt+Enter. ReSharper C++ will suggest a list of options for how to update the capture list.
In this version, we’ve upgraded the built-in Clang-Tidy binary to Clang 9, to give you many new code checks and accompanying fixes. Importantly, the bundled binary no longer prevents modifications to the source files. Clang-Tidy also starts more quickly as it doesn’t wait for all other ReSharper C++ analyses to finish.
Clang-Tidy settings were improved in a couple of areas:
ReSharper C++ gives you hints about your code to help improve its readability. New code hints added in v2019.3 help you identify types that might not be obvious when you look at modern C++ code:
In ReSharper C++ 2019.3, several live templates were renamed to match the corresponding language keyword. For example, to generate a class, type class (was cls before); for structures, use struct instead of str; and use similar logic for unions, enums and namespaces.
Go to file member was improved in two ways:
In initializer lists, code hints help you better understand what you are actually initializing. Now, you can also navigate to the aggregate class from the opening brace of a brace-enclosed initializer list.
In ReSharper C++ 2019.3, it’s now possible to export
your formatting settings to a .clang-format file. Use
ReSharper | Options |
Code Editing | General Formatter Style | Write current style to .clang-format.
Two new formatter options were added to control the spacing:
ReSharper C++ 2019.3 can now check the order of the
#includes directives in your code. Simply provide the ordering settings,
and a corresponding inspection and a quick-fix will help you notice if they’re
out of order and reorder them in no time.
When ReSharper C++ detects you are developing an Unreal Engine project, it adjusts its behavior to be more UE4-specific.
The “new” postfix template for
UCLASSes expands to a proper factory function call
(which will register the created object in the garbage collector).
Live templates with the corresponding names are now available to help
you quickly generate
Unreal Engine’s Smart Pointers (
TSharedPtr, TSharedRef, TWeakPtr, TUniquePtr)
are now handled by ReSharper C++ similarly to
std::shared_ptr/std::unique_ptr. This means features like Parameter Info,
code analysis, and postfix code completion work for Smart Pointers.
Finally, there are some performance improvements for UE4 projects. For example, we fixed a hang after "Refresh Visual Studio Project" in the UE4 editor.
For custom compiler toolchain or custom build tool cases, ReSharper C++ 2019.3 adds ReSharper Project Properties. They are stored in the ReSharper settings and allow you to specify:
Thanks to some improvements in the code highlighting engine, re-highlighting now happens faster. After a function’s body is changed, only the body will be reanalyzed.
Find Usages was sped up by adding a heuristic based on the graph of includes. This helps by cutting out the files without any usages.
There are more changes coming from ReSharper. You can learn about them here.
In this release, we have finalized what we have been working on over the last few release cycles, and can now officially announce there is a new preprocessor implementation used inside ReSharper C++. There are two of them now, in fact – a newer one used for indexing, and an older one used for everything else. This new one delivers 15-25% faster indexing on typical solutions, like LLVM and Unreal Engine.
In code completion, ReSharper C++ shows a summary tooltip for
each item in the completion list (controlled by the Show summary checkbox in the
IntelliSense | Completion Appearance page of the ReSharper options). The description for the
selected completion item is now colored and shows the documentation for the corresponding item.
The editor has even more code hints to help improve code readability. New hints were introduced after preprocessor directives and for function arguments that are passed by a non-const reference, while hints in aggregate initialization expressions now show the names of the initialized base classes.
The C++20 standard is almost ready to be signed off on by the C++ committee. And naturally, we are working hard to get fully compliant support in. ReSharper C++ 2019.2 got support for:
Typing assist in multiline comments was improved. First of all, multiline comments that use single-line syntax are automatically extended. Second, extending multiline comments now inserts correct indentation when virtual space is enabled.
Wrapping code blocks with braces is now even easier – just select a block of code or an expression and then type an opening brace. ReSharper C++ will do the rest for you:
There are a whole bunch of new formatter options inside ReSharper C++ 2019.2:
New inspections are available to help you catch more code smells:
The Use static_cast fix for the C-style cast used inspection can be run in bulk and as part of Code Cleanup.
Code navigation actions got an accuracy-targeted update:
Besides, you can search in a file right through the Go to File member dialog. The result list will have names of all matched members, and all the places where the search string appears in the file.
In the previous release, we began to work towards better support for UE4-specific Remote Procedure Calls. Now, we've updated the Rename and Change Signature refactorings to work correctly on RPC functions. A few new code analysis checks are also available for UE4-based code, especially targeting the missing or incorrectly set UE4 reflection macros.
Following on from adding code completion for reflection specifiers in v2019.1, we've now added built-in documentation for them. It is shown in the Quick Documentation popup (Ctrl+Q) when the caret is located on a specifier.
ReSharper C++ 2019.2 provides initial support for the
“Per-Monitor DPI Awareness” mode introduced in Visual Studio 2019. We’ve also updated the
ReSharper | Options | Environment | Performance Guide page, adding a Windows
Defender section as well as descriptions for all performance tips explaining what exactly
will be done after a suggestion is applied.
There's some good news for plugin writers, too: C++ assemblies from ReSharper C++ are now included in the ReSharper SDK!