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: Move class to new file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

peterchen
Tomato Guru

126 Posts

Posted - Mar 28 2012 :  10:07:30 AM  Show Profile  Reply with Quote
I've [url=http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=8336]suggested this before[/url], back then it was rejected with "we currently don't consider creating new files". Tis was a while ago, so please reconsider :)

What I have in mind:

When the cursor is over the class name of a class declaration, offer a refactoring command "move to new files". You ask for the file name, the suggestion is based on the folder of the current file and the name of the class.

What this operation could provide (considering C++):


  • Create new header file with declaration

  • Create new body file with implementation (only if required?)

  • Boilerplate for these two files can be taken from VA refactoring macros

  • replicate namespace(s) from the "source" file around the class definition

  • replicate using statements from the "source" file that are in effect at the point of the class definition.
    [*] add includes based on required symbols (not sure if this available), or based on the current file(s).



Especially for C++, where you have to deal with two files (or deal with one of those wizards), these things are flow breakers. There are certainly some open quesitons here, but I don't see any major problems as such.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Mar 28 2012 :  11:46:54 AM  Show Profile  Reply with Quote
These are very good ideas, thank you for the detailed description. Since your last request, we have created a case for this idea:

case=31484

I have added a comment containing your ideas, so the devs can consider them when they get to this. Maybe not all ideas will be included in the first iteration, though.
Go to Top of Page

peterchen
Tomato Guru

126 Posts

Posted - Mar 30 2012 :  10:36:32 AM  Show Profile  Reply with Quote
Great! I'm Looking forward to it!

The details are just collection of ideas anyway. If it works at all, I'm sure the community will make sure it gets polished ;)

Edited by - peterchen on Mar 30 2012 10:38:11 AM
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