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
 Feature Requests
 Move Implementation to source file for selection
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

av0tar15
Junior Member

19 Posts

Posted - Oct 05 2008 :  7:57:15 PM  Show Profile  Reply with Quote
Hi,

It would be great if I could select several methods in header file and apply Move Implementation to Source file to all of them at once. Instead at present I must apply it one by one on each method.

A use case. I create a derived class from class with 24 abstract methods. I've replaced '= 0;' with some default body by the use of Find and Replace and now want all this stuff in the body. The feature would save me some copy/pastes and find/replaces.

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Oct 06 2008 :  06:41:26 AM  Show Profile  Reply with Quote
We are considering doing something like this, but using VA Outline to select the methods instead of selecting them in the editor its self:

case=7787

This bypasses any problems with selecting just half a method, or any confusion over which methods VA thinks it is going to move.

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

av0tar15
Junior Member

19 Posts

Posted - Oct 06 2008 :  6:50:04 PM  Show Profile  Reply with Quote
In my opinion VA Outline wouldn't work that well for this because one doesn't see which methods have bodies and what code particular body contains. As for confusion, I'd suggest to move every method that is at least partially selected, that would fit my style just fine.

The whole point is to implement the idea of a particular refactoring that came to mind with as as few keystrokes as possible.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Oct 07 2008 :  07:27:11 AM  Show Profile  Reply with Quote
When you have member variables mixed in with your member functions, or multi-line member functions (parameters wrapped onto several lines) then you may be selecting the last parameter of a function, or even just a keyword or macro after the closing bracket for the function. Is that selecting the function? It is a grey area, since you can argue yes it is and no it is not.

This is why VA Outline is useful, it is clear cut to specify what you are doing.

Using Shift + Down arrow to select several lines of code takes about the same number of key presses as selecting several items in VA Outline with shift + down arrow.

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

av0tar15
Junior Member

19 Posts

Posted - Oct 08 2008 :  7:18:29 PM  Show Profile  Reply with Quote
Actually, I'm using mouse to select the code, this really speeds things up :). My opinion - just grab all the curly braces in my selection and make sure I don't see them after "Move to Implementation" action. So I would prefer "yes" answer to the gray area question.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Oct 09 2008 :  07:16:02 AM  Show Profile  Reply with Quote
Just looking for curly braces is not going to help much. Consider this piece of code:

class CInterestingCode
{
    struct MemberStruct
    {
        int nMember1;
    };

    int nMember2;

    void MultiLineFunc(
            bool bParam1,
            bool bParam2
            )
            const
            { /* body here */ }
};


Here it is easy to find sets of lines that in isolation are unclear, assuming you are actually selecting entire lines. As soon as you start selecting just parts of a line at either end of your block of code it gets even more "fun".

This is before I start getting clever by using Macro's to hide curly brackets, or to create default implementations.

Assuming for the moment that all of these problems are solved. You then select the entire class body and open the refactoring menu. You are going to see Move Implementation and Encapsulate Field at a minimum. So two quite different commands, which will do quite different things, based on the same selection. Throw in partial selections and it becomes less clear what a given command will actually do.

Selecting a range in VA Outline with the mouse, try single left click then Control + single left click. Arguably as quick, and less error prone

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

av0tar15
Junior Member

19 Posts

Posted - Oct 24 2008 :  12:51:18 PM  Show Profile  Reply with Quote
What I'm trying to say is that personally I'm ok with resolving the ambiguity towards including everything that can possibly be included. I understand that you would like to avoid user confusion, but on other hand most "confusion-prone" guys are ok to go click UI instead of editing some code. At the moment I'm still doing my coding in code window, and going to any helper is a distruction to some extent.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Oct 27 2008 :  1:27:53 PM  Show Profile  Reply with Quote
I can see this being useful, but I can also see this generating a certain amount of problems for support. I have asked internally to see what other people think of this.

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

StefanEgo
Ketchup Master

56 Posts

Posted - Oct 29 2012 :  03:36:45 AM  Show Profile  Reply with Quote
Well, I've to second av0tar15's user experience here. In the described use-case for me as well it would be less comfortable to use VA Outline to do the job, because I'm normally working in the code-window (and not VA Outline).

I do understand that ur decision might be to stick with the VA Outline solution and don't consider adding this feature to the refactoring-entry in the right-click context menu when having selected a code block. Nevertheless, from my pure user point of view, that would be more accessible for me as well. ;-)
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Oct 29 2012 :  10:15:56 AM  Show Profile  Reply with Quote
In build 1918, Move Implementation to Source File is offered on the class declaration for bulk operations (case=68102).
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