Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 "Move to Source" moves to wrong file

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
dewtell Posted - Jun 14 2011 : 2:36:08 PM
When doing a "move to source file" refactoring from foo.h, if there is no foo.cpp in the same directory, but there is a foo.cpp or Foo.cpp elsewhere in the solution, the code will probably be moved there. I ran into this with one file, and needed to restart Visual Studio (after creating foo.cpp in the correct directory) in order to break the link to the wrong file.

This is with Visual Assist X version 10.6.1850.0 and Visual Studio 2008, Professional Edition.
3   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jun 14 2011 : 8:10:19 PM
The problem is that how you define a "completely unrelated file". We have made several improvements on how alt+o works (switching between related files) and through this process I have seen a lot of "odd" variations about where people tend to keep their corresponding files. Not everyone keeps the corresponding files in the same directory to say the least. A warning that may be inappropriate, may break the flow and may cause more frustration / distraction than benefit.

Personally, I always create the corresponding files at the same time to avoid problems like this or others.

Anyway, VA usually does a very good job at catching up changes, including file creations. However, in this case VA "caches" the file location it found, for some reason. Normally this shouldn't cause any inconvenience. Is this a frequent problem you run into?
dewtell Posted - Jun 14 2011 : 3:58:09 PM
Well, I'd like it to at least be able to warn me that (in this case) it's about to move the code to a potentially completely unrelated file (in this case, it took a core engine .h file and moved the code to a GUI file with the same name/different case). I suppose this warning should be configurable, for people who intend to keep their .h and .cpp files in different directories, but I think the default should be to warn.

In this case, I created the correct .cpp file by using cmake, which rebuilt the solution file on disk. So Visual Studio did re-read the updated solution file from disk, and Visual Assist still kept trying to move the code to the wrong file until I completely got out of Visual Studio and restarted it from scratch.
feline Posted - Jun 14 2011 : 3:24:03 PM
I am not quite sure what to say here. If the correct destination file does not exist when you initially trigger Move Implementation to Source File then VA obviously cannot use this file, so VA did its best.

Once you have added the file to the solution, you have to save the solution before VA will learn about the new file, since we read the solution file from the hard drive, not from memory. Reloading the IDE will save the solution and let VA learn about the new, matching file, but doing a "File -> Save All" should also help.

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