ReSharper的C#格式化风格表演及QUOT

ReSharper的C#格式化风格表演及QUOT

本文介绍了ReSharper的C#格式化风格表演及QUOT;新"新行而不是同一行斩波排长队时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以ReSharper的是把一个换行符前的新在我的代码重新格式化时,如下所示:

 无功富=新富
{
酒吧= NULL,
巴兹=
新巴兹
{
Bap的= NULL,
博克= NULL ,
帮助=
新PweaseHelp
{
Korben = NULL,
达拉斯= NULL,
多道= NULL
},
我=
新ClearlyMyAbilityToUnderstandResharperSettingsIs(
空),
}
};



但是我真的很喜欢它太做到这一点:

 无功富=新富
{
酒吧= NULL,
巴兹=新巴兹
{
Bap的= NULL,
博克= NULL,
说明=新PweaseHelp
{
Korben = NULL,
达拉斯= NULL,
多道= NULL
},
我=新ClearlyMyAbilityToUnderstandResharperSettingsIs(空),
}
};



我钻研虽然我在.DotSettings文件(县)的所有设置和我可以科技工作是什么原因造成它...任何帮助将是非常赞赏:)



下的R·选项进行配置:





be configured under R# options:

EDIT: With my settings, the closest I've come to your proposed solution is setting Wrap object and collection initializer to Chop always, but then, for some reason, it ignores the "Array and object initializer" setting under Braces layout and puts the opening brace on the same line, like this:

var foo = new Foo {
    Bar = null,
    Baz = new Baz {
        Bap = null,
        Bork = null,
        Help = new PweaseHelp {
            Korben = null,
            Dallas = null,
            Multipass = null
        },
        Me = new ClearlyMyAbilityToUnderstandResharperSettingsIs(null),
    }
};

It could be some other settings I have that is causing this, but to me this looks like it's bugged. Maybe you should contact ReSharper Support and have them take a look at it...

这篇关于ReSharper的C#格式化风格表演及QUOT;新"新行而不是同一行斩波排长队时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 11:40