Formatting breaks line before function definitions
I have some code that looks like
SOME_ANNOTATION_MACRO()
int foo()
{
return 0;
}
But I can't seemingly get R# formatter not to add a new line between the macro and the function declaration, i.e. formatting results in:
SOME_ANNOTATION_MACRO()
int foo()
{
return 0;
}
Apparently they get treated as 2 functions definitions (the macro and foo), and forcing no extra line break between function definitions is the only work around I found for this issue. Problem is, I want to keep some space between function definitions, and I wonder if this is a known issue and if there's a solution for this.
Please sign in to leave a comment.
Hello,
What does the annotation macro expand to?
well, that depends on the compiler, this is the macro I'm using:
This is a bug, I've filed https://youtrack.jetbrains.com/issue/RSCPP-25325.
As a workaround you can either put the annotation on the same line as the function definition, or make it non-empty just for R++: