3

I have a problem with Resharper and auto formating braces. Since a while Resharper don't add closing braces while I am typing an opening brace. Also when I am typing a closing brace at the last line of a method, the closing brace of the method will be removed.

Example:

private void Method()
{
    if(true)
    { // If I type '{' resharper of vs2010 will normally add a '}' 
      // but I don't know why not now
}
private void AnotherMethod(){}

If am am manually add the closing brace the closing brace of the method is removed and AnotherMethod() is indented.

private void Method()
{
    if(true)
    {
    } // Why is the closing brace of the method removed?
    private void AnotherMethod(){}

My related settings of resharper:
Formatting style > Braces Layout:
- Braces Layout: for all At next line (BSD style) (and Empty braces formatting: On different lines)
- Force Braces: for all Add braces

IntelliSence > Completion Behavior:
- Enabled: Automatically insert parentheses after completion
+- selected: Both opening and closing

Editor
- Enabled: Auto-insert closing brace
+-selected: On typing an opening brace

What are the required resharper settings to solve this problem?

Sam Holder
  • 32,535
  • 13
  • 101
  • 181
hwcverwe
  • 5,287
  • 7
  • 35
  • 63

0 Answers0