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
 Technical Support
 Refactoring scope (Project / Solution)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

philip
Starting Member

1 Posts

Posted - Mar 23 2007 :  05:08:24 AM  Show Profile  Reply with Quote
Win XP SP2
Visual Studio 2005 SP1
VA X (1544)
-----------------------------------------------------------------------

VA seems not to distinguish between project scope and solution scope (former workspace).

Solution
|-CppProjectA
| |-ClassA
|-CppProjectB
| |-ClassA
|

A rename operation in CppProjectA on ClassA will affect ClassA in CppProjectB too. Of cource one can uncheck all items that should not be affected but this can be hard going.

Adding a method to CppProjectB/ClassA.cpp and using Create Declaration leads to another problem. In this case the declaration is created in the wrong header file (CppProjectA/ClassA.h).

Is there a workaround for these issues?

best regards

feline
Whole Tomato Software

United Kingdom
18952 Posts

Posted - Mar 23 2007 :  1:34:01 PM  Show Profile  Reply with Quote
We are considering adding an option to Find References to limit it to only the current project, which would help with the rename operation, since rename depends upon Find References.

At a code level, how do you distinguish these two classes? Are they in different namespaces? When I have placed multiple projects in one solution it is to use the code in projectA in projectB. Once I understand what is going on here I will set up a test project and see what happens for me.

case=2490

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

sl@sh
Tomato Guru

Switzerland
204 Posts

Posted - Mar 26 2007 :  05:32:32 AM  Show Profile  Reply with Quote
This is a situation that has come up for us as well. It is caused by various third party libraries that are all included into one solution. Since the libraries themselves basically don't "know" about each other they mostly use only their local includes, so for each of them only one of the duplicate classes is visible. This is not the whole truth however, it's a bit more complicated than that. but unfortunately it cannot be easily resolved at this moment since a lot of inherited code hangs on it.

While there are very few such cases it is one we have to deal with at the moment (just working on some fixes...). For example we have several libraries that use a 3D Point type - a GUI lib, a basic vector math library, and several specific libraries that have a number of very specialized algorithms working on points in space. Some of these use different names although the object and functionality should be (and mostly is) the same, some are named alike, although conceptually they should be different (i. e. vector versus point). Only some of the libs actually expose their Point type(s) on their interfaces, and these are only used locally within the main program, so we currently have no conflicts despite not using namespaces.

Obviously, in this convoluted case, renaming within a project wouldn't be enough. However, it would at least provoke compiler errors within the main project. So the total process of refactoring could be resolved within reasonable time.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18952 Posts

Posted - Mar 26 2007 :  3:04:10 PM  Show Profile  Reply with Quote
That makes sense. Have you considered using the IDE's "find and replace in files" feature, which has the ability to run only on the current project?

It is not the same as VA's rename, but for simply renaming classes it might work quite well, and it does have the "advantage" of picking up references in comments and strings.

zen is the art of being at one with the two'ness
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