Is there an option in ReSharper to not put an object initializer on multiple lines?

别说谁变了你拦得住时间么 提交于 2019-12-04 02:27:05

If you want to keep ReSharper from formatting your object initializers (so you can decide how you want to format them yourself), I think a combination of these settings will do the job.

Keep existing line breaks : [Checked]

Place simple array, object and collection on single line : [Checked]

Wrap object and collection initializer : 'Simple wrap'

Wrap long lines : [Unchecked]

Of course, these settings might not fit everyone's situation, but I'm sure you can adapt them to your needs.

It looks like you need to set Wrap object and collection initializer option to Chop if long in Code Editing -> C# -> Formatting Style -> Line Breaks and Wrapping section.

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