ReSharper C++ 2020.1 EAP: Rearrange Code, Code Completion, and UE4 Naming
With this EAP build, the well-known Rearrange code and Complete Statement features from ReSharper for .NET have finally come to ReSharper C++! Read on for details about these features, as well as other highlights of this build:
- Rearrange code: an easy way to move your code.
- Complete Statement: one shortcut instead of many routine actions.
- Completion in macro definitions: code completion now works in macros.
- UE4 naming conventions: rules for console variables and log categories.
Download the new ReSharper C++ EAP build from our website, or via the Toolbox App.
ReSharper С++ now allows you to quickly rearrange expressions, statements, and other elements in your code. To rearrange code, press Ctrl+Shift+Alt over the code element or selection that you want to move, then press any arrow key. If you invoke this command without first selecting something, the movable element is selected automatically.
The Move up and Move down commands are pretty straightforward – they can move elements within a specific scope up and down relative to other elements in this scope, or between neighboring scopes. You can use the Move up and Move down commands on statements and declarations, sections in a switch statement, enumerators, catch sections within a try-catch statement, conditions or branches in if statements, and more.
You can also move opening or closing braces up or down to expand or shrink the current compound statement, type, or namespace:
There are also two modes for Move left and Move right, which allow you to:
- Rearrange elements that are normally written in a single line (though they also work if the elements are written in multiple lines). You can use Move left and Move right on elements in a braced initializer list, as well as function or lambda parameters and arguments, and so on.
- Move a statement or a declaration into the region that directly follows it (move right) or outside the current region (move left):
The Complete Statement feature inserts required syntax elements and puts the caret in a position where you can start typing the next statement.
With ReSharper C++, you can now use the Ctrl+Shift+Enter shortcut instead of having to perform lots of other small actions. For example, this shortcut will automatically insert braces and a semicolon, and then put the caret where you can proceed to write the body:
Completion in macro definitions
It is hard to believe that code completion had remained unsupported in macro definitions. Until now! Starting with 2020.1, ReSharper C++ now provides context-aware code completion in macros to help you be even more productive:
UE4 naming conventions
We introduced support for Unreal Engine naming conventions a year ago in the 2019.1 release. But if there is something to improve, we are always ready to do it. In 2020.1, we’ve upgraded our naming rules with two small entries: ReSharper C++ now works better with the names of console variables and log categories.
Those are all the major improvements in this update. The full list of changes, including bug fixes and minor improvements, can be found in our issue tracker.
Your ReSharper C++ team
The Drive to Develop