Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 How to sort lines with function name not type?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ndh
Junior Member

13 Posts

Posted - Sep 25 2012 :  01:48:30 AM  Show Profile  Reply with Quote
Hi, I want to sort selected lines with function name not type,like this
class A
{
A B1();
B A1();
}
->
class A
{
B A1();
A B1();
}

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 25 2012 :  3:13:24 PM  Show Profile  Reply with Quote
Unfortunately, you cannot do that. But are you aware of VA Outline?

VAssist -> Tools -> VA Outline

You can easily rearrange your source code via drag-and-drop in this window which maybe an easier way to sort your source.
Also, are you aware of alt+m list? This list already is in alphabetical order and you can even filter it by typing.

Furthermore, we are considering a VA Outline command to sort selected items alphabetically:

case=20370
Go to Top of Page

ndh
Junior Member

13 Posts

Posted - Sep 26 2012 :  12:30:45 AM  Show Profile  Reply with Quote
I think switch to VA Outline is not convenience. Shortcut key is needed. VS has the box selection feature, so why not sort the lines from the first column of the selected area.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 26 2012 :  11:39:18 AM  Show Profile  Reply with Quote
You can dock VA Outline, I usually keep it on my side of my monitor. It also convenient for navigation: try it in a cpp file, it will show just the symbol names, without the actual details.
Speaking of which, this is one of the many advantage of the VA Outline window: you can actually rearrange (and maybe sort later) the implemented functions and method as well, because VA Outline handles them as a whole, so when you move a line in VA Outline, you actually move the method body as well.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Sep 26 2012 :  8:19:04 PM  Show Profile  Reply with Quote
Box selection assumes that all of the function names line up, and that you don't have code that looks like:

class A
{
    virtual A B1();
    longReturnTypeName A1();
}

which is actually quite common.

zen is the art of being at one with the two'ness
Go to Top of Page

ndh
Junior Member

13 Posts

Posted - Sep 27 2012 :  10:22:21 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline

Box selection assumes that all of the function names line up, and that you don't have code that looks like:

class A
{
    virtual A B1();
    longReturnTypeName A1();
}

which is actually quite common.


Maybe we need a coding style formatter to format it to
class A
{
virtual A B1();
longReturnTypeName A1();
}
This style is clean.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Sep 28 2012 :  11:48:32 AM  Show Profile  Reply with Quote
Unfortunately the forum has not shown your formatting, but I am guessing you are talking about having VA line up the function names. We don't have any current plans to add code formatting to VA, partly because everyone who wants code formatting wants it to work slightly differently.

This FAQ entry has links to a couple of different code formatting tools that you might want to have a look at:

http://docs.wholetomato.com?W147

Alternatively, if your IDE has macros, you could try:

IDE Tools menu -> Macros -> Macro Explorer -> Samples -> VSEditor -> LineEmUp

zen is the art of being at one with the two'ness
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 28 2012 :  1:24:43 PM  Show Profile  Reply with Quote
We are considering to add a command at some point to sort selected text based on the last word / symbol on the line:

case=32391

This is something that would work even without doing a code formatting, first.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000