C# formatting question break; after a block

I could use a little help as I am asure I am missing something.  I'd like to get Resharper to format my switch statements a little differently then it is, but can't find a way to adjust the behevior.

What I'd like to see is my break statements outside of my case blocks to be directly underneath the closing brace of the case block.

     switch(foo)
     {
          case BAR.one:
          {
          }
          break;

          case BAR.two:
          {
          }
          break;

          .     
          .
          .

          default::
          {
          }
          break;
     }

What I get is the break ends up indented an extra tab:

     switch(foo)
     {
          case BAR.one:
          {
          }
               break;

          case BAR.two:
          {
          }
               break;

          .     
          .
          .

          default::
          {
          }
               break;
     }



This isn't a problem when writing the code as it is quick to fix, but it is a pain when auto formatting kicks in.

Any help woudl be appreciated.


2 comments
Comment actions Permalink

I have this same problem in C++ (with Resharper++).

This seems to have been a problem since 2014...?

No one has any ideas how to fix this?

0
Comment actions Permalink

I would like to be able to configure the same behavior Douglas specified in his original post. In my case, this is also specific to using switch blocks as noted by Douglas. I am using RS 2018.1.2 and cannot figure out how to stop RS from adding the blank line before the break statement.

0

Please sign in to leave a comment.