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

后端 未结 3 1244
后悔当初
后悔当初 2020-12-10 10:08

I quite often use the ReSharper \"Clean Up Code\" command to format my code to our coding style before checking it into source control. This works well in general, but some

相关标签:
3条回答
  • 2020-12-10 10:43

    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.

    0 讨论(0)
  • 2020-12-10 10:51

    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.

    0 讨论(0)
  • 2020-12-10 10:56

    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.

    0 讨论(0)
提交回复
热议问题