Consider the following line of code:
things.Add(new Thing { ID = null, Name = 'a thing' });
The whitespace formatting you see there is that which I get when I type the closing ;.
Now, if I ask Visual Studio to reformat my code, or I type a closing } it gets reformatted:
things.Add(new Thing{ID = null, Name = 'a thing'});
I prefer the first style of formatting.
I am using ReSharper 4.0 and Visual Studio 2008 SP1.
How can I get them to agree on whitespace around braces?
I have been having this problem too and, although I’ve learned to live with it, your question made me want to fix it.
Turns out there’s an option in VS that ought to help:
Deselect Automatically format completed block on
}and any other options you find offensive.For future, you can file defects on the R# Jira site. It’s also work searching this site to see if a solution to your problem has already been posted.
Have you tried the R# 4.5 Nightly Builds yet?
EDIT Following your comment:
I would disable all of the Visual Studio formatting and only use the ReSharper formatting. It’s much more configurable. Does this not achieve what you want?