如何防止 ReSharper 在我的 MSpec 字段之间插入空行?

Tim*_*ong 1 c# resharper code-formatting mspec

当我编写这样的 MSpec 上下文时:

[Subject(typeof(TheType), "Concern")]
internal class when_this_test_is_run
    {
    Establish context = () =>
        {
        // some code...
        };

    Because of = () => Do.Something();
    It should_do_this;
    It should_do_that;
    }
Run Code Online (Sandbox Code Playgroud)

当我让 ReSharper 重新格式化代码时,它总是在任何作为匿名方法的委托下方插入一个空行,即以块{作为}其主体。它不会在简单表达式的委托后面插入空行。因此,在上面的示例中,Establish context委托会生成一个空行,但Because ofIt委托不会。

这让我发疯,因为我不希望它插入空行,但我不知道需要更改什么设置来阻止它发生。

有任何想法吗?

Ale*_*kin 5

尝试这个:

  1. ReSharper | Options | Code Editing | C# | Formatting Style | Blank Lines | Preserve existing formatting | Keep max blank lines in declaration | Select '0'
  2. ReSharper | Options | Code Editing | C# | Formatting Style | Blank Lines | Blank lines | Around field | Uncheck