问题
My Resharper 8 is auto formatting on the end brace. The top brace moves to the end of the IF statement line. How can I have it format to the next line.
Starting statement
if (condition)
{
var x = new foo();
}
When the bottom brace is removed and retyped this is the result. The top brace moves to the end of the line above.
if (condition) {
var x = new foo();
}
The desired result is the initial starting statement.
How can I change the options in R#8 to fix this? I have tried changing options in the C# / Formatting / Braces layout
options.
回答1:
I found it. Under Formatting Style --> Line Breaks and Wrapping --> Preserve Existing Formatting, change "Break line in a block with a single statement" to "break line".
来源:https://stackoverflow.com/questions/20083452/resharper-moving-top-brace-next-to-if-statement-how-to-have-on-new-line