Lasse V. Karlsen
Lasse V. Karlsen

Reputation: 391336

Disabling ReSharper reordering of code during code reformatting?

I use the code reformatting tool in ReSharper to get some standard format on my code, but I don't like that it moves methods around.

For instance if I rename a method, and then reformat, the method is moved. This makes merging changes between branches a nightmare.

Is there any setting I have missed that will disable this particular part of the reformatting?

Upvotes: 4

Views: 553

Answers (2)

yeyeyerman
yeyeyerman

Reputation: 7921

You should modify the Type Members Layout xml for that. In that file you have several patterns which you can reorder or delete to get the behaviour you want. All the changes you make in that file will be reflected in the following file:

C:\Documents and Settings\user\Program Data\JetBrains\ReSharper\v4.5\vs8.0\UserSettings.xml

so you can make a backup before playing with it or add it to your source code tree.

Upvotes: 1

noonand
noonand

Reputation: 2855

Set up a custom R# profile

Click Resharper > Tools > Code Cleanup

Then choose "Edit profiles", add a new profile, deselect what you don't want and save it.

Run this profile in the future

Upvotes: 3

Related Questions