How do you preserve blank lines between the MSpec delegate types?

103 views Asked by At

Prior to Resharper 9, the default code reformatting preserved up to 2 blank lines between fields which meant that you could keep a blank line between your Because and It delegates like so:

public class when_something
{
  static object obj1;
  static object obj2;
  static object obj3;

  Establish context = () => { };

  Because of;

  It should_1;

  It should_2;
}

As of Resharper 9, the default is to remove blank lines around single line fields, so it collapses everything together like so:

public class when_something
{
  static object obj1;
  static object obj2;
  static object obj3;

  Establish context = () => { };

  Because of;    
  It should_1;    
  It should_2;
}

The default is already set to Preserve Existing Formatting -> Keep max blank lines in code = 2, but the Blank Lines setting for single line field seems to override this. If you change the setting under Blank Lines then it forces you to have blank lines and you will end up with blank lines after all your fields like so:

public class when_something
{
  static object obj1;

  static object obj2;

  static object obj3;

  Establish context = () => { };

  Because of;    

  It should_1;  

  It should_2;
}

How do you configure Resharper 9 to preserve the blank lines if they are there?

0

There are 0 answers