Is there a way to mark up code to tell ReSharper not to format it?

半城伤御伤魂 提交于 2019-11-28 10:40:22

Resharper>Options>Languages>C#>Formatting Style>Other>

Uncheck "Indent anonymous method body" and "Indent array, object and collection initilizer blocks" and anything else that strikes your fancy.

As a last resort, if you've got legacy code that you don't want to format but you want additions to the class to be nicely formatted, then make the class partial and put new code in the new file.

chafnan

Check out this question I asked that involves the same issue: Resharper formatting code into a single line

The answer I got there work really good for me.

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