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

peterchen
Tomato Guru

126 Posts

Posted - Nov 15 2008 :  04:49:52 AM  Show Profile  Reply with Quote
I am one of those lazy guys who type up a new class in a file it might belong to, only to later convince myself it would be better to hold it in a separate file.

Suggestion: Add an option "Move to new file" for classes and structs. This may be applicable for other entities (functions, current selection) , and work for different languages.

For C# classes / structs, I would expect the following features:

- create a new file based on the class name in the root
(wiht some automatic suffix when this is not unique, it#s easy to remname and move around in VS)
- preserve namespaces
- preserve using declarations

This would be nice in C++, too, creating a .h and a .cpp file automatically.

feline
Whole Tomato Software

United Kingdom
18942 Posts

Posted - Nov 18 2008 :  08:40:25 AM  Show Profile  Reply with Quote
We do not have any current plans to create new files.

There are a couple of reasons for this, firstly source control systems. They should be told about new files.

Secondly where to place the files? Once you get a large solution, containing several projects and folders, it is not at all clear where the file should go.

Once you get into C++ and .h files living in a different location to .cpp files the problem gets quite complex.

However once you have created the file VA Outline should prove useful. You can use this to select the parts of the current file that you want to move, then just cut them and paste them into the new file

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

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Nov 18 2008 :  12:21:33 PM  Show Profile  Reply with Quote
At least for C# classes this would be already a bit easier, and seriously its much less work to move a file to the right place than to create it and move the contents to it.
About source control I would not really worry too much, the user has to add the file anyway to it. Just as he would have to with imported files.
Go to Top of Page

peterchen
Tomato Guru

126 Posts

Posted - Dec 03 2008 :  11:25:40 AM  Show Profile  Reply with Quote
I understand your concerns, creating enw files opens up a batch of related problems that I didn't think of either. I think they are solvable at least in the given scenario.

For file location:
Even in large projects, the same folder as the originating file is a good idea. The functionality will be most likely related, and even in large, deeply structured projects, related functionality goes together.
Also, at least in C# et al. it is very easy to move a file to a separate folder.

I would not worry about source control in general, all I'd expect is (the option to) add the file to the current project. In an environment with source control integration, this may automatically trigger adding to source control. In a manually controlled environment, you are already done.

I do see a potential problem with adding to the project and using Visual Studio + Visual SourceSafe integration: In VSS, moving a file breaks the history, and is a ugly manual process. All we poor sods stuck with VSS would need is making "add to project" an option that can be disabled.

When disabling "add to project", just having both files open (and unsaved) would allow me to fairly quickly place them on disk and add them to the project. It's not the perfect solution, but still helps those people that would run into troubles with the default.

However once you have created the file VA Outline should prove useful. You can use this to select the parts of the current file that you want to move, then just cut them and paste them into the new file

Oooh shiny! I have to try that :)
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