开发者

Resharper force space after curly bracket and before closing bracket

Resharper is giving me this:

new MyObject {Prop1 = prop1, Prop2 开发者_开发问答= prop2}

But I want:

new MyObject { Prop1 = prop1, Prop2 = prop2 }

Currently it's breaking my StyleCop rules.


I think this is the setting you are looking for.

http://screencast.com/t/nEXMHo6Ko Dead link

--Edit--

In case of a dead link, The setting is under C# -> Formatting Style -> Spaces -> Within single-line initializer braces. Check the box next to it and you'll be all set.


you can get resharper to match stylecop here by putting these lines in .editorconfig

resharper_space_within_empty_braces = true resharper_space_within_single_line_array_initializer_braces = true

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜