开发者

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?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜