2 Replies Last post: Nov 11, 2013 6:29 PM by Genadij Trimailov  
Genadij Trimailov Newbie 4 posts since
Sep 24, 2012
Currently Being Moderated

Nov 7, 2013 7:57 PM

Idea: Arranging Methods in a Class

Hello.

 

I cauught myself arranging methods (with Shift+Alt+Ctrl+ Up, Down) accorging to the execution quite often, especially when the new methods are always automatically generated by R# under a current methods.

 

So, here is an example of what I get by generating 3 methods and what I would like to get instead:

 

validation_rearrange.png

 

Option 1:

The best option here would be to search where exatly a method needs to be inserted, for example if I generate ValidateDigits() last, R# would find that the decalration of the method is between other two methods and put it there. Of course, any of the methods could have been in the base class or in a different file, but then the rules could apply like that:

 

1. between two methods

2. after first method

3. beofre second method

4. after current method

 

Option 2:

I believe that most of the time developers add new methods top to bottom, so maybe it is a good idea to have new methods generation in the end of the

 

Option 3:

Have an option of rearranging methods as a "Cleanup" option.

Matt Ellis Novice 362 posts since
Jul 5, 2009
Currently Being Moderated
Nov 8, 2013 3:33 PM in response to: Genadij Trimailov
Re: Idea: Arranging Methods in a Class

You might want to look at the Greenkeeper plugin for ReSharper 8 - it will arrange your code in "newspaper mode" or in the order they're used.

More Like This

  • Retrieving data ...