Resharper force space after curly bracket and before closing bracket

别说谁变了你拦得住时间么 提交于 2020-01-01 23:35:08

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/6066437/resharper-force-space-after-curly-bracket-and-before-closing-bracket

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