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
 Extract method for C++
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

NOPcode
Ketchup Master

USA
84 Posts

Posted - Apr 03 2008 :  08:00:59 AM  Show Profile  Reply with Quote
One thing that is getting more and more annoying is when I use the Extract Method function in a traditional .h/.cpp project, it always puts the method body in in the .h file, so then I have to fuss with Move Imp. to Source File (which is another annoyance - it is fussy about being active, so I have to often try right-clicking multiple times to get it to be used).
How about some way to control this for non-.NET development?

feline
Whole Tomato Software

United Kingdom
18940 Posts

Posted - Apr 03 2008 :  08:57:18 AM  Show Profile  Reply with Quote
We have tried to keep the refactoring operations as simple, quick and easy to use as possible. They are also designed to be chained together.

One reason for this is that no matter what we do, it is going to be "wrong" for some people. So it is keep the actions simple, or ask a lot of questions all of the time.

We have discussed internally some method for chaining refactoring operations together automatically, but this is just a vague idea at the moment. You might find this FAQ entry on using IDE macro's to control refactoring helpful:

http://docs.wholetomato.com?W382

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

chrisd
Junior Member

20 Posts

Posted - Apr 03 2008 :  6:03:26 PM  Show Profile  Reply with Quote
feline,
I have always had the same response to this as NOPcode, how about just changing the behavior if the ctrl key is pressed when the option is selected from the menu?

Chris
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18940 Posts

Posted - Apr 04 2008 :  09:42:58 AM  Show Profile  Reply with Quote
Assuming for the moment we do this, the next problem is going to be where is the function placed in the cpp file?

We already have this problem with Move Implementation to Source File, and this will add the same problem to Extract Method. If we are not careful we will start to "blur" the lines between these two operations. From a support, and also making them do what people want point of view, I am wary of this.

This is why the idea of somehow chaining together the refactoring operations sounds appealing, at least on paper.

Looking beyond Extract Method, how long before people reasonably ask for the same modifier for Add Member, Add Similar Member and Create Implementation?

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 - Apr 04 2008 :  8:01:17 PM  Show Profile  Reply with Quote
quote:
Looking beyond Extract Method, how long before people reasonably ask for the same modifier for Add Member, Add Similar Member and Create Implementation?


This is why "Move Implementation to Source File" is great.
The only minor problem is that it always put the method at the end of the file, but placing below the implementation of preceding function
is under consideration.

quote:
I have to often try right-clicking multiple times to get it to be used

The re-parse time currently about 1 second for little files like an average header. I am waiting for about 1 second before pressing my shortcut to Move Implementation.

Alternatively, you can write a macro which call reparse and then do a Move Implementation Not the same what you want, but can be a solution if you don't want to wait at all.

Edited by - accord on Apr 05 2008 11:59:11 AM
Go to Top of Page

NOPcode
Ketchup Master

USA
84 Posts

Posted - Apr 09 2008 :  11:09:45 AM  Show Profile  Reply with Quote
Basically, what I'm asking for is a simple checkbox in the config options to automatically do the job, by putting the code at the end of the target .cpp file. Otherwise, you're just annoying C++ developers by jamming everything into the header.

I'll try the macro concept out, but not a monster fan of macros - always seem to foobar the IDE. Seems like a hack workaround to make the thing do the proper job in the first place.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18940 Posts

Posted - Apr 10 2008 :  3:52:24 PM  Show Profile  Reply with Quote
The problem with "the proper job" is that if you ask 6 people you are likely to get 6 definitions of what should happen.

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

NOPcode
Ketchup Master

USA
84 Posts

Posted - Apr 11 2008 :  2:02:30 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline

The problem with "the proper job" is that if you ask 6 people you are likely to get 6 definitions of what should happen.



Yes, which is why I'm asking for a checkbox option in the settings for this. You have .h/.cpp file-flipping, and yet the extract only uses the .h file...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18940 Posts

Posted - Apr 14 2008 :  1:40:30 PM  Show Profile  Reply with Quote
I have asked internally about this. We like to keep the number of options to a minimum, but there is clearly a desire / need for more control over refactoring.

zen is the art of being at one with the two'ness
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