Take the 2-minute tour ×

CodeRush has this nifty plugin called cr_ClassCleaner that allows me to sort the elements in the class (e.g. methods, private variables, etc...).

Can Resharper 5.x do this, either via the product or plugins?

share|improve this question
You'd have to be really careful with a feature like that. If someone use that on a file, while also making some changes, and checked it in, I wouldn't be able to tell what they did to the code. Sounds dangerous. –  Merlyn Morgan-Graham Feb 16 '11 at 18:00
Yes it can. Also, if you like coding style plugins check this: stylecopforresharper.codeplex.com –  Tuomas Hietanen Feb 16 '11 at 18:19
generally resorting code is a dangerous thing –  tofutim May 18 '13 at 7:12

3 Answers 3

up vote 7 down vote accepted

Yes - ReSharper, Tools, Cleanup Code.

They recently blogged about customising the type layout this generates.

share|improve this answer

There is an option in code cleanup to reorder type members. This would be done as part of a full cleanup. If you wanted to only reorder, you could create a cleanup profile that only included that step. You can have multiple cleanup profile.

share|improve this answer

Ctrl+Alt+F (if you're using the IDEA profile) will take you to the cleanup code menu where you can achieve that.

share|improve this answer
or Ctrl+E, Ctrl-C in the default profile –  Rup Feb 16 '11 at 18:04
I am looking at the Cleanup Code dialog, there is an option to reorder code elements. If I proceed with it, it does not sort the methods. –  AngryHacker Feb 16 '11 at 18:31
I don't think it reorders the contents of each group by default, no. But you can configure it to - see Sorting, Grouping and Regions at the bottom of this blog post. –  Rup Feb 17 '11 at 0:05

Your Answer


