views:

230

answers:

1

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?

+1  A: 

The solution we use is to remap Visual Studio's shortcut for "Format Document Ctrl K, Ctrl D" to ReSharper's Code Cleanup. We also use a plugin to manage sharing ReSharper settings through source control. The built in ReSharper shared settings functionality does not share all settings e.g. Inspection Severities and custom Code Cleanup profiles.

I have a blog article that describes sorting the keyboard mapping out, and setting up the "manage settings" plugin:

http://gojisoft.com/blog/2010/05/10/coding-standards-using-resharper/

chibacity