Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alphabetizing methods in Visual Studio

Is there any sort of plug-in or tool available for Visual Studio 2008 to alphabetize methods? Ideally I'd like a tool that will alphabetize a selection, or specified type (i.e. only methods, not member variables), either automatically or on-demand.

like image 941
80bower Avatar asked Jan 21 '09 18:01

80bower


People also ask

How do I alphabetize in Visual Studio?

You just select the lines you want to sort and Alt+3 or Alt+4 (asc/desc).

How do you sort alphabetically in VS code?

Select the code you wish to sort in Visual Studio Code. Then hit the key combination Ctrl+P and type the greater than sign ( > ). Next type sort and choose Sort Lines Ascending or choose the Descending option. Now the lines you've previously selected will be sorted by the option you chose.


1 Answers

While Resharper has many cool features it has a large impact in CPU and I/O usage and can be very complicated to use. It is also only available under commercial licensing unless you qualify for a few very specific free use licenses.

Try CodeMaid. It is free for commercial use and has a much lower performance overhead. I find it easy to use and it is very good for alphabetizing methods.


To sort your file, open the file via solution explorer:

  1. Right click the open file
  2. Code Maid menu (likely near the top of the right click menu)
  3. Click Reorganize Active Document

Alternatively, using the default CodeMaid hotkeys CTRL+M,Z to sort your active file.

like image 107
Gabriel Andrés Brancolini Avatar answered Sep 24 '22 02:09

Gabriel Andrés Brancolini