ReSharper C++ Settings -> Braces Layout -> "Regular expressions for macros starting a block"

Hi, I'm seeking information about ReSharper C++ Settings --> Braces Layout --> "Regular expressions for macros starting a block" (also end block)

Does this refer to C++ macros that RSCPP should recognize to be formatted with braces?

Otherwise, I was wondering if this was some sort of general way to provide some kind of ReSharper macro that would control braces formatting in general.

Thank You

 

0
2 comments

Hello,

These settings were introduced basically in order to support MacroBlockBegin/MacroBlockEnd clang-format options and work in the same way. Consider this example:

#define BLOCK_BEGIN
#define BLOCK_END

void foo()
{
    BLOCK_BEGIN
    int x;
    BLOCK_END
}

Normally "int x;" won't be indented compared to BLOCK_BEGIN, but if you set "Regular expressions for macros starting/ending a block" to BLOCK_BEGIN/BLOCK_END, "int x;" will be indented.

0

Please sign in to leave a comment.