Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Refactoring: Rename files

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
khb Posted - Jun 23 2006 : 10:30:08 AM
I used the new refactoring tools to rename a class. Works perfectly. However, after renaming the class I also needed to rename the source files (.h & .cpp), because I want class and files to have the same name. This is always awkward (remove files from project, rename them externally, put them back to project, correct include commands). It would be nice, if one could use some refactoring functionality to do this. E.g., open refactoring menu on include file and choose "Rename files". I don't know if this makes sense in all cases, but for my case it would really save me some time

Regards,
Marcus.
16   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 03 2012 : 10:48:21 PM
Moving files is an interesting idea, I have put in a feature request to see what our developers make of it:

case=69734

I doubt this will be done soon though, if it is done at all, since moving header files will require checking #include statements, to try and avoid breaking things.
Aqua Posted - Sep 28 2012 : 02:41:02 AM
Rename file support is great.
Just today I wanted to move a file to a different subfolder - it's a pity that this is not supported yet - idea for a next build ? (supposing this is manageable w.r.t. underlying VCS-systems).
support Posted - Sep 13 2012 : 2:05:28 PM
case=1463 is implemented in build 1916
feline Posted - Sep 16 2006 : 3:48:19 PM
it is unlikely we would ever try to integrate with VCS and rename files there. there are a lot of different source control systems out there, in active use, so if we pick only one when everyone who uses a different one will be on to us to support that one as well.

also it is unlikely we are ever going to run out of ideas for new features, or suggestions.
V.Solo Posted - Sep 13 2006 : 12:24:22 PM
I'd very much like this "Rename File" refactoring as well. Manually updating all the #includes is time consuming, error-prone and tiresome .

As for VCSes, I believe the most cost-effective solution would be to ignore the issue altogether in the near term, except, perhaps, for notifying the user and letting him handle it. To this end I can only repeat what khb said :
quote:
Ok, simple rename would break SVN, but you could copy the renamed files back to their old names and do the remove/add game manually again. For me this would be easier than doing all the changes in the code manually.

(except that I'd do a SVN rename, instead of the "remove/add game", and let SVN sort it out)

Once WT team runs out of ideas for new features, file rename VCS integration can be revisited. Per-VCS plug-ins that know what should be done to preserve history of the renamed file in the repository, configurable paths to VCS executables, optional log messages and what not.

But I'd like the "simplest thing that could possibly work" first.
feline Posted - Jun 27 2006 : 3:30:37 PM
i did manage to rename a solution, including the generated exe, in VS2005 via the IDE, but i do not have any instructions, i did it all by trial and error.

i started by copying the directory the solution sat in, to the new name. the interesting discovery was that VS2005 allows you to rename a solution in solution explorer.

i ran into some problems shortly after this, due to using CVS for our source control, and when i copied the directory it rather upset / confused CVS *rolls eyes*

this experience suggests we all follow bugfix's advice in future
bugfix Posted - Jun 27 2006 : 03:05:12 AM
This is pretty much straigtforward:)
Rename solution by selecting it in solution explorer, press f2, enter new name.
Save solution as "newname"

Changing exe name has nothing to do w/ solution, thats part of the project:)
If you want to change a projects name I've found it by far easier using an external editor doing some S&R. If you want to change a projects name whithin IDE you need to go through all options and fix stuff!
FWIW, if you want to use one project as a base for a new project make sure you delete the following line inside the .vcproj file:

ProjectGUID="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"

VS will create a new guid when adding the project to the solution. This guid is needed for doing project dependencies.
patent pending:P

-bugfix
khb Posted - Jun 27 2006 : 02:03:36 AM
Feline, I don't know if this is the right place for it, but are you interested in sharing your renaming solution with us? A short how-to would be great.

Regards,
Marcus.
feline Posted - Jun 26 2006 : 1:06:42 PM
from the point of view of the IDE, and the compiler, and possibly VA as well, a "copy to new name" approach might cause additional problems, since you suddenly have two identical copies of the same code, with different names. which one do you jump to via alt-g, which one gets compiled, etc.

it could be this would not cause any problems at all, but i suspect it could cause "strange" problems. but then, maybe i am just being suspicious after all, the basic IDE is just SO rock solid, stable and reliable... well, it is when it is not locking up, crashing, or refusing to compile my code successfully *rolls eyes*

as for renaming solutions and projects, i have put in a "is this even possible?" feature request. i would not hold your breath on this one, but we can ask

case=1476

i did manage to rename a solution in VS2005 via the IDE, but it was not that easy or straight forward, and i had to change the name of the produced exe file as well, when i realised that was also wrong. so this may be possible, at least for VS2005.
khb Posted - Jun 25 2006 : 2:14:03 PM
Thank you for adding my idea to the feature requests. The simple solution would be all right for me. Renaming projects would be great, too. It happens again and again that I have to rename a project and this always ends in setting up a new project. And this takes its time...

@bugfix: Ok, simple rename would break SVN, but you could copy the renamed files back to their old names and do the remove/add game manually again. For me this would be easier than doing all the changes in the code manually.

Regards,
Marcus.
bugfix Posted - Jun 24 2006 : 09:28:40 AM
A simple rename already breaks SVN:) But then I don't have to use that feature at all.
As for project renaming, I doubt it's possible while IDE is running. Sure you can rename the project but the project file itself?
feline Posted - Jun 24 2006 : 08:16:31 AM
i have put in a feature request for rename file

case=1463

the simplest solution, of simply renaming the files is probably the best, rather than copying them, leaving the user to work out what they are doing with there source control system.

renaming projects and solutions is an interesting idea. i recall trying to do this by hand once in VS2003, and i ended up editing the vcproj file by hand, and doing various other things as well. so i certainly did not find a lot of support for this in the IDE.

is there much interest in this idea?
khb Posted - Jun 24 2006 : 02:11:13 AM
I see. It seems, I got used to CVS too much However, maybe there's a useful solution for my idea anyway. Renaming whole projects would also be great

Regards,
Marcus.
bugfix Posted - Jun 23 2006 : 3:02:23 PM
Well it pretty much depends on the RCS you are using, e.g. SVN has a builtin rename/move which keeps the version unlike old dumbo CVS. Anyways I'm no dev of VAX, I just wanted to point out this problem, it's up to VAX devs to solve it if they're going to implement this feature:)
khb Posted - Jun 23 2006 : 2:36:40 PM
You are right. But then, copying instead of renaming would do the trick. Then you could still remove the old files from the repository as they still exist and simply add the "new" ones. Ok, you could say putting the same code in two different files at the same time isn't nice, but renaming the files manually when using a VCS would result in the same steps.

Regards,
Marcus.
bugfix Posted - Jun 23 2006 : 12:07:48 PM
I like the idea too but it can cause trouble w/ version control systems.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000