4

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. enter image description here

Valamas
  • 24,169
  • 25
  • 107
  • 177

1 Answers1

5

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".this is where in resharper you change it

xofz
  • 5,600
  • 6
  • 45
  • 63