views:

1744

answers:

3

I'm code purist, preferring own style of code formatting (opposite to suggested by VS 2008) I've turned off auto-formatting options in Tools/options. In most cases it works.

But noticed that after refactoring VS demolishes my code... (Eg after using such option as encapsulate field, extract method, using surrounding snippets...)

This really makes me crazy!

if you know cure - please share ...

A: 

there is a similar thread here

Konstantinos
thanks tip in thread you listed VS desnt touch et least fields when doing encapsulation - but still my problem remains unresolved... :(
Maciej
+2  A: 

I doubt that you can disable re-formatting after refactoring. Refactoring changes code and since it's only text I doubt what you'd want is that it just dumps unformatted text into your source. Wouldn't it be a little easier to just set the code style VS adheres to to the style you like and follow?

Joey
A: 

You can tweak the settings of the code formatting. I always turn off all extra line breaks, and then it works fine for how I format the code.

If you tweak the settings as close as you can to your preference, that should leave you minimal work whenever you use refactoring.

Guffa
I wrote that I did that but it doesnt help when you are using refactoring, code surroundings...
Maciej
@Maciej: I Can't see that you wrote that anywhere. It only says that you turned the auto formatting off, not that you changed the settings.
Guffa