Author |
Topic |
|
khb
Tomato Guru
Germany
337 Posts |
Posted - Jun 21 2006 : 07:15:44 AM
|
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
|
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. |
|
|
khb
Tomato Guru
Germany
337 Posts |
Posted - Jun 21 2006 : 11:15:01 AM
|
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. |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jun 21 2006 : 1:21:06 PM
|
Clever. |
|
|
khb
Tomato Guru
Germany
337 Posts |
Posted - Jun 22 2006 : 02:25:17 AM
|
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. |
|
|
PatLuja
Tomato Guru
Belgium
416 Posts |
Posted - Jun 22 2006 : 02:48:55 AM
|
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. |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jun 22 2006 : 2:26:16 PM
|
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 |
|
|
|
Topic |
|