Resharper C# Formatting Style shows “new” on new line instead of same line when chopping long lines

ぃ、小莉子 提交于 2019-12-03 07:01:53

If you are using R# 7.1 it could be due to the new Code Formatting Improvements. All this behavior can easily 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...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!