Resharper C++ - Auto-Format unary operator

Hi there,

I'd like to auto-format this:

if (! bool_var)

into this:

if (!bool_var)

 

I can see that there are options for unary operators for C#, but not for C++.

Is there any other way to configure this? If not, could you take this as an enhancement request for one of the next versions?

Kind Regards,

Branko

0
4 comments

Hi Branko,
Please try "ReSharper | Options | Code Editing | C++ | Formatting Style | Spaces | In expressions | After logical NOT operator (!)".

The easiest way to set up formatting style: when you have a perfect-looking piece of code, select it and choose "Format selection -> Detect formatting settings" from the context menu.

0

Hi Elvira,

thanks for your reply.

But unfortunately, I cannot find this setting. This is how it looks for me:

And when I search, I find it only for C#:

I'm using the latest version of Resharper C++ (2022.3.3).

Kind regards,

Branko

0

Hello Branko,

This setting was added to C++ in 2023.1 (https://youtrack.jetbrains.com/issue/RSCPP-32260). Please try the 2023.1 EAP build, or the final release should be out in a couple of weeks.

0

Hi Igor,

thanks for the hint. Installed EAP9, option is there and formatting is working. Thanks :)

Kind regards,

Branko

 

0

Please sign in to leave a comment.