Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I align ReSharpers "cleanup code" with Visual Studio's "format document"

I'm a big fan of ReSharpers "cleanup code" feature. Especially the Solution wide clean up.

But I use Visual Studio's Ctrl+K+D (Format document), it formats the code slightly differed than ReSharper.

I'm on a quest to align ReSharper with Visual Studio (not the other way... because you can not share Visual Studio settings in the solution/source control system).

So I'm after something like this:

<Configuration>
  <CodeStyleSettings>
    <Sharing>SOLUTION</Sharing>
    <CSharp>
      <FormatSettings>
        <SPACE_AROUND_MULTIPLICATIVE_OP>True</SPACE_AROUND_MULTIPLICATIVE_OP>
        <SPACE_BEFORE_TYPEOF_PARENTHESES>False</SPACE_BEFORE_TYPEOF_PARENTHESES>
      </FormatSettings>
    </CSharp>
  </CodeStyleSettings>
</Configuration>

Which other settings will help ReSharper format code like Visual Studio?

like image 533
Thomas Jespersen Avatar asked Apr 25 '10 19:04

Thomas Jespersen


1 Answers

Here is how I've mapped Visual Studio's shortcut for "Format Document Ctrl K, D" to Resharper's Code Cleanup:

enter image description here

like image 91
Adrian Bystrek Avatar answered Sep 20 '22 22:09

Adrian Bystrek