Early Access Program

ReSharper C++ 2023.1 EAP: Macro Expansion Preview

A new week, a new Early Access Program build packed with improvements and bug fixes! Read on for the highlights and check out the full list of issues we’ve fixed in this update.

You can download the EAP builds from our website or via the Toolbox App.

DOWNLOAD RESHARPER C++ EAP

Preview of macro substitution

We’ve significantly reworked the macro substitution preview. You can now see the macro expansion with syntax highlighting and proper code formatting in tooltips on hover! You can still use the Substitute macro call context action to check out the macro expansion right in the code, but the instant preview makes working with macros easier:

Preview of macro substitution

With the Quick Documentation popup (Ctrl+Shift+F1), there’s even more: you can now click any entity from the substitution preview to check out its documentation, as well. If there is an issue with your macro, it will be highlighted in the substitution preview of both the on-hover tooltip and the Quick Documentation popup.
Issue with a macro

Code analysis

We’ve introduced a new inspection with a quick-fix to pass a parameter by a const reference. ReSharper C++ will suggest you update the way you pass a parameter if it’s copied for each invocation, or when the parameter type is passed by value but is expensive to copy:

Pass a parameter by const reference

The following new inspections will help you clean up your code by getting rid of redundancies:

  • Inspection with a quick-fix to remove an unused typedef or type alias.
    Unused typedef
  • Inspection with a quick-fix to remove a redundant base class initializer.
    Redundant base class initializer

The inspection for a non-void function without a return statement now offers one more quick-fix! You can now both add a return statement and change the function return type to void:

Change return type to void

When there is a possibly erroneous empty statement in your code, ReSharper C++ will suggest replacing it with a {} block, which is a good starting point for fixing the missing piece:

Possibly erroneous empty statement

Other improvements

We continue to make code completion more helpful for experimenting with C++20 modules. ReSharper C++ now suggests module names when you are about to import a module:

Completion for module names

The Introduce variable refactoring now uses direct initialization for constructor calls where possible (RSCPP-33796).

Updates to the formatter bring a new option to configure line breaks after init-statements and a bug fix for blank lines before Unreal Engine macros.

That’s all for now! Please try out the new build and share your feedback with us. If you encounter any issues, don’t hesitate to report them to our issue tracker.

DOWNLOAD RESHARPER C++ EAP

Your ReSharper C++ team
JetBrains
The Drive to Develop

image description