T O P I C R E V I E W |
philip |
Posted - Mar 23 2007 : 05:08:24 AM 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 |
3 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Mar 26 2007 : 3:04:10 PM 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. |
sl@sh |
Posted - Mar 26 2007 : 05:32:32 AM 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. |
feline |
Posted - Mar 23 2007 : 1:34:01 PM 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 |
|
|