T O P I C R E V I E W |
fspafford |
Posted - Feb 04 2011 : 12:24:19 PM I work with some tools that create C source files, and the tools are bad about rearranging routines. This makes it more difficult when comparing the files to see what has changed.
It would be nice if VA could rearrange the routines in sorted order.
|
9 L A T E S T R E P L I E S (Newest First) |
pwc |
Posted - Jul 23 2015 : 6:06:10 PM Sorting the cpp file to match the h file would be great. |
sean |
Posted - Feb 13 2015 : 8:17:37 PM case=12454 is fixed in build 2059 |
feline |
Posted - May 10 2014 : 6:51:49 PM Are you aware that you can manually sort a part of a file using VA Outline, which supports both drag and drop via the mouse, and cut and paste:
http://docs.wholetomato.com/default.asp?W187
Sorting just part of a file, assuming you want both the header and cpp files to be in the same order, is if anything more complex than sorting the whole file, since the part of the file you are sorting may not be grouped together. |
hackish |
Posted - May 08 2014 : 4:18:59 PM While I understand the need to build a sort feature that would appeal to everyone, I would love it if I could select some or all of a class and have it automagically sort. If you wanted to extend this to cover more cases then maybe allow the user to supply a regex for the sort order. So for those who want their get/set methods grouped together they could consider something like /[gs]et.*/ |
feline |
Posted - Apr 16 2014 : 11:39:57 AM Sorting the cpp file to match the header file is something we are looking into doing:
case=56425
As you say, there are a number of edge cases to consider, just for a change Keeping the two files in the same order is something we are considering, at least if you are using VA refactoring commands. For example, we are looking to make Move Implementation to Source File more order aware, but since we cannot assume the two files are actually in the same order, we are looking at just the surrounding functions for this:
case=12454 |
jay.carlton |
Posted - Apr 16 2014 : 10:16:09 AM Would it be possible to rearrange a cpp file to match the order of method declarations in the correpsonding .h file? Granted, you'd have to deal with the a class split among multiple translation units, multiple classes per header, and several classes implementing interfaces in the same header, but in the common case of one header for each class file, it would seem like a natural way to order the implementation file. You'd probably also want an option to put static functions stuff at the top of the cpp file.
Eventually you might want some kind of template or rearrangable pattern to describe the standard for how classes should be laid out. This is one area where C++ gives you too much flexibility, and it's hard to maintain things in any particular way.
You'd probably also need a rule saying that anything in a COM interface has to stay in its original order, or automation clients relying on the layout of your virtual function tables would break.
But any solution to this problem would ideally need to keep the header synchronized with the cpp file. |
feline |
Posted - Feb 21 2011 : 12:16:18 PM Based on some of the posts I have read over time, I have the feeling that different people will want their code sorted and grouped differently. For example some people want accessors grouped together.
We don't currently have any plans to try and do this, since sorting is more complex that it first seems, and VA Outline is designed to help you easily keep the files sorted how you want them. |
TudorT |
Posted - Feb 19 2011 : 1:31:05 PM An automatic "Sort Methods Alphabetically" especially when combined with "Sort Methods By Access" type (private/public) would help a lot. |
feline |
Posted - Feb 07 2011 : 1:36:29 PM VA Outline is designed to help here, you can use it to simply drag and drop items into the desired order:
http://www.wholetomato.com/products/features/vaoutline.asp |