Home > Resharper > Resharper format settings

Resharper format settings

10 June, 2009

I can never remember these so thought it best to write them down. Start with the settings from:

http://codebetter.com/blogs/aaron.jensen/archive/2008/10/19/getting-resharper-and-vs-to-play-nice-with-mspec.aspx

Plus a few extras…

Go to menu Resharper –> Options –> Languages –> C# –> Formatting Style

  • Braces Layout –> All set to (BSD style)
  • Braces Layout –> Empty braces formatting = Together on the same lineimage
  • Blank lines – I don’t like a lot of blank lines so I set mostly to 1/0image
  • Other –> Align Multiline Constructs – Call arguments = Off

  • Other –> Align Multiline Constructs – Expression = Offimage

  • Other –> Other – Indent array, object and collection initializer block = Offimage

Regions

Stop Resharper adding regions to interface implementations and nested classes:

Go to menu: Resharper –> Options –> Languages –> C# –> Type Members Layout

Un-tick Use Default Patterns and you get a text area full of xml. Scroll to the bottom and delete the section:

<Group>
  <ImplementsInterface Immediate="true" Region="${ImplementsInterface} Members"/>
</Group>

image

Also  delete the section:

<Group>
  <Name Region="Nested type: ${Name}"/>
</Group>

image

Finally click Ok.

Code Cleanup

Go to menu Resharper –> Options –> Tools –> Code Cleanup

Add a new profile with the following settings:

image

I didn’t realise I had fiddled with the default settings so much no wonder I can never remember them.

Advertisements
Categories: Resharper Tags:
  1. No comments yet.
  1. 4 November, 2009 at 11:16 pm
Comments are closed.
%d bloggers like this: