如何防止ReSharper在我的MSpec字段之间插入空白行? [英] How can I prevent ReSharper from inserting a blank line between my MSpec fields?
问题描述
当我这样编写MSpec上下文时:
When I write an MSpec context like this:
[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;
}
当我让ReSharper重新格式化代码时,它总是在任何委托下方插入一个空行,这是一个匿名方法,即以{
块}
作为其主体.它不会在作为简单表达式的委托之后插入空白行.因此,在上面的示例中,Establish context
委托占用空白行,但是Because of
和It
委托却没有.
When I let ReSharper reformat the code, it always inserts a blank line beneath any of the delegates that is an anonymous method, i.e. has a {
block }
as its body. It doesn't insert blank lines after delegates that are simple expressions. So in the example above, the Establish context
delegate gest a blank line, but the Because of
and the It
delegates do not.
这让我发疯,因为我不希望它插入空白行,但是我无法弄清楚我需要更改哪些设置以阻止它发生.
This is driving me crazy as I don't want it to insert the blank lines, but I can't figure out what setting I need to change to stop it happening.
有什么想法吗?
推荐答案
尝试一下:
-
ReSharper | Options | Code Editing | C# | Formatting Style | Blank Lines | Preserve existing formatting | Keep max blank lines in declaration | Select '0'
-
ReSharper | Options | Code Editing | C# | Formatting Style | Blank Lines | Blank lines | Around field | Uncheck
ReSharper | Options | Code Editing | C# | Formatting Style | Blank Lines | Preserve existing formatting | Keep max blank lines in declaration | Select '0'
ReSharper | Options | Code Editing | C# | Formatting Style | Blank Lines | Blank lines | Around field | Uncheck
这篇关于如何防止ReSharper在我的MSpec字段之间插入空白行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!