Resharper moving top brace next to if statement. How to have on new line?

陌路散爱 提交于 2019-12-10 16:12:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!