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
 Refactoring: Remove declaration
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 21 2006 :  07:15:44 AM  Show Profile  Reply with Quote
Sometimes I move functions from one .cpp file to another one. Before cutting the function from the first file it would be nice if the refactoring menu had a "Remove Declaration" feature. After that I could simply do a cut & paste and finally an "Add Declarion" in the new file to completely move the function. What do you think?

Regards,
Marcus.

support
Whole Tomato Software

5566 Posts

Posted - Jun 21 2006 :  10:51:44 AM  Show Profile  Reply with Quote
Interesting idea which hadn't come to us.

VA X normally adds code, e.g. completing as you type. We get nervous when VA X changes code, e.g. Extract Method. We'd have to be really careful if we start removing code.
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 21 2006 :  11:15:01 AM  Show Profile  Reply with Quote
I see. However, if I choose "Change Signature" in the .cpp file and completely delete the line in the edit box its nearly the same, just a semicolon is left in the header file

Regards,
Marcus.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jun 21 2006 :  1:21:06 PM  Show Profile  Reply with Quote
Clever.
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 22 2006 :  02:25:17 AM  Show Profile  Reply with Quote
Ok, but that's not the best solution, as the line with the semicolon is left over in the header file. I just wanted to show you with this example that some kind of "remove" already exists in VA. So, adding a "Remove Declaration" shouldn't be much more dangerous. And as long as the undo function works...

A confirmation dialog for remove functionality would also be ok for me...

Just some food for thoughts

Regards,
Marcus.
Go to Top of Page

PatLuja
Tomato Guru

Belgium
416 Posts

Posted - Jun 22 2006 :  02:48:55 AM  Show Profile  Reply with Quote
Hello all,

When I hear this, also another Refactoring function comes to mind: "Move Declaration and Implementation...", which should move the Declaration and the Implementation to a file-pair (.h and .cpp) of your choice...

The only thing is, where do you want to have it? Maybe you want to move this to a place within a class declaration, which maybe is somewhat harder to do.

With kind regards,
Patrick Luja

P.S. Nevertheless, "Remove Declaration" is still a useful function, even when this function should be implemented.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jun 22 2006 :  2:26:16 PM  Show Profile  Reply with Quote
it seems someone has already thought of remove declaration

case=1101


when i need to move functions i tend to use alt-g to get the two most recent files to be the implementation and declaration of the function, which makes it easy to move the code to a new file via CTRL-TAB.

throw in Find References and this may help you do this manually.


zen is the art of being at one with the two'ness

Edited by - feline on Jun 22 2006 2:26:39 PM
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