Author |
Topic  |
FWillen
Senior Member
  
Germany
45 Posts |
Posted - Mar 07 2011 : 12:36:18 PM
|
In some Projects Refactoring isn't working properly. In the folowing line Refactoring is working on the variable theApp but not on variable MessageString. If I select Refactor (VA X) => Find References, I will get a messagebox "Find References is not available because the symbol is unrecognized". Of Course MessageString is defined. If I click on contextmenu => Go To Define, VS will show me the correct definition line.
void wrtmess(int i,int nFNr,CString mstr) { ... theApp.MessageString = mstr; ... }
I've allready rebuild the symbol databases and cleared the history, cache and temporary files.
What else can I do to make VA Refactoring working again?
My Development Enviroment: Visual Studio 2005 Professional Edition SP1 - German Version 10.6.1837.5 built 2010.12.14 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Mar 07 2011 : 4:03:27 PM
|
Go To Define is an IDE command, so the IDE intellisense understands this code correctly. We just need to find out why VA is having problems.
If you show VA View, then place keyboard focus back into the editor, and now hover the mouse over "theApp" is the correct information displayed? This should show you the members of the class / type that "theApp" is.
What does VA show in the context and definition fields for "theApp"?
I am wondering if it is just "MessageString" that is a problem, or if VA is having problems with most of the members of this type. |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - Mar 11 2011 : 01:31:07 AM
|
Thanks, now I know what happens, but I still think this is a bug.
In my solution I have the following projects:
Sollist (with the class CSollistApp) SollistClient (with the class CSollistClientApp)
In the first project Sollist I defined the variable CSollistApp theApp;
But VA-View doesn't show me the class CSollistApp, if I hover over the variable theApp. VA shows me the class CSollistClientApp of the second project. And Of Course, CSollistClientApp doesn't have the variable MessageString. So the mistake is that VA refers to the wrong class in the wrong project.
If I select Find References on the variable CSollistApp theApp, VA will show me the references of the both following variables:
CSollistApp theApp in project CSollistApp CSollistClientApp theApp in project CSollistClientApp |
 |
|
v_v
Senior Member
  
Russia
29 Posts |
Posted - Mar 16 2011 : 03:32:04 AM
|
I have the similar problem (VAX build 10.6.1842). There are two projects in a solution (vs2008) having different classes with the same name (CSearchContext). They have similar set of public members, but different private ones. And there are red lines under private members definitions in one of project (and all the refactoring tools are disabled):

And the same situation with all classes/structures that has the same name. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Mar 16 2011 : 10:59:13 PM
|
FWillen are the two variables "theApp" local variables? Class members? Global? Does alt-g on a use of "theApp" take you to the correct declaration?
Are either of you using namespaces to try and distinguish code in the two projects?
Does turning on:
VA Options -> Advanced -> Listboxes -> Get content from default Intellisense
help at all? This might help with listboxes, but not with underlining or refactoring unfortunately. |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - Mar 17 2011 : 12:54:01 PM
|
Both theApp are global variables. One Variable of class CSollistApp, the other of class CSollistAppClient. I don't use any namespaces.
Alt-g shows me the declaration of both variables and all external declarations.
Get Content from default Intellisense was allready checked. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Mar 17 2011 : 10:44:02 PM
|
FWillen I have reproduced the problem here, thank you for the clear description:
case=56104
In your code how do you know which version of "theApp" you are using at any given time? Are you only one project's version within the same file / project? Or are you sometimes using it outside of the project?
Is renaming one of the two variables an option for now?
v_v, are your problem classes only used within the project where they are declared, or are they used in different projects as well? |
zen is the art of being at one with the two'ness |
 |
|
v_v
Senior Member
  
Russia
29 Posts |
Posted - Mar 18 2011 : 01:44:58 AM
|
One of them is used only within the project (Native C++), the other one is a public interface in CLI-project (there are no problems in this project). |
Edited by - v_v on Mar 18 2011 03:23:50 AM |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - Mar 18 2011 : 02:42:10 AM
|
There is only one version of theApp in every project. But the most solutions have more than one project, each with one version of theApp. So every projects has only on version of the variable, which is accessable and known.
Renaming isn't an option for us. |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - Mar 18 2011 : 03:23:37 AM
|
I don't know if this behavour belongs to the same problem.
Alt-O sometimes leads to the wrong file. I have the file configset.cpp and configset.h in two projects, one solution. Sometimes I am in the file configset.h (Class Configset) of project A and hit Alt-O. VA leads me to configset.cpp (Class Configset) of project B. Because the classes have allmost the same content, I don't recognize it and make changes in the wrong configset.cpp. Of Course it doesn't work, if I compile the project.
I don't know under which circumstances this happens. The most time it works but sometimes VA shows this behaviour. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Mar 18 2011 : 8:35:51 PM
|
Thank you for the clarification on how these duplicates are used, I have put some notes onto the bug report about this.
FWillen I am not sure what is happening with Alt-O. The behaviour should be consistent, always right or always wrong. Do you ever see a menu when pressing Alt-O, where VA has listed 2 destination files, and needs you to pick one of them? This happens when VA is unable to determine the correct destination file.
But normally Alt-O should be able to match up pairs of files correctly, and automatically.
Is it possible you are using some other command, perhaps Alt-G to jump to the other file? |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - Mar 21 2011 : 08:35:55 AM
|
Thanks!
I never got a menu when pressing Alt-O. And I can't imagine that I have use Alt-G. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Mar 21 2011 : 2:56:48 PM
|
Can you please open all of the "problem" files, and then try Alt-O from each one of them in turn, and see if you end up in the correct, matching file?
It is possible Alt-O only fails in one specific file. So if you rarely use Alt-O in that file you will only see this problem occasionally.
But unless the project is changing, the number of files with the same name is changing, or the files locations are changing, the Alt-O behaviour should be constant and reliable. At least in theory. |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - Mar 24 2011 : 06:22:37 AM
|
I couldn't reproduce this behaviour. It happens occasionaly, so I believe it happens with a file where it works before. But I'm not sure. If it happens again, I will take a look at it.
|
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Mar 24 2011 : 2:33:44 PM
|
Any information you can provide to help me reproduce this problem will be most welcome. At least it is not happening all of the time, this is something. |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - May 21 2011 : 05:57:19 AM
|
It just happend that VA isn't working properly. I wanted to add a member to a class ConfigSet, Project A and wanted to use the addMember-function. Additionally Info: ConfigSet exists in two projects and VA. ConfigSet, project A wasn't opened, but I'm not sure if ConfigSet of project B was opened.
Then I wanted to use the "go to declaration" function of VS. I got a message Member not found. After some searching I looked into ConfigSet in project B and found the Variable defined in class ConfigSet Project B. It was not possible to reproduce this behaviour. Alt-O was working correctly. Closing ConfigSet of Project A doesn't lead to this behaviour
|
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - May 23 2011 : 11:39:40 AM
|
Do you mean that VA's Add Member command added the new variable to the ConfigSet in project B, not Project A? |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - May 23 2011 : 11:48:54 AM
|
Yes |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - May 23 2011 : 11:57:30 AM
|
Thank you, I was not quite sure at first.
This is very strange. The fact that you cannot reproduce, and that Alt-O is working correctly, suggest that normally VA is able to parse and understand all of the code involved. Do you have:
VA Options -> Performance -> Parse all files when opening a project
turned On or Off? I am just wondering if this was turned Off, and then VA might not be aware of all of the code until the files were opened. |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - May 23 2011 : 12:08:08 PM
|
"Parse all files when opening a project" was and is still selected. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - May 24 2011 : 2:15:03 PM
|
Unfortunately I have no idea what to make of this. It almost sounds like VA did not know about the ConfigSet in Project A, but that does not make sense, given you have parse all files turned on.
Is this a common problem, or does this seem to have been a one off problem? |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - May 25 2011 : 12:53:58 AM
|
This happens from time to time. It is getting worser, if I make several changes and don't recognize it. Just the same with Alt-O. How can I supply you more informations?
But I have another suggestion for VA: In many solution I have switch / cases and need much time to navigate between the cases. It would be a great function if you would supply a kind of function overview where I can easily switch between the cases in a function. For large function it maybe a good idea to integrate a switch show only current location or all conditions in the current function. If the function should show only the current location void testfunction { if (my condition2) { if (my condition1) { Switch (my var) case (case1): if (my condition3) {
} case (case2): case (case3): } else { } } }
Do you have any solutions for case=56104?
|
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - May 25 2011 : 12:56:50 AM
|
Bad tab-key ;-)
I haven't finished my text.
If the function should show only the current location, it should display all cases in the "upper condition" , all if condition in the current case, but not all if condition in other cases.
|
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - May 25 2011 : 12:52:12 PM
|
Are you able to reproduce an Alt-O problem on demand? Duplicate symbol names should not be effecting Alt-O. There might be a separate problem here.
I have increased the priority on:
case=56104
for you, hopefully this will help a bit.
For your suggestion, are you talking about what VA shows in its Context field, or its Definition field? Or something else? |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - May 26 2011 : 06:33:53 AM
|
No, I can't reproduce this behaviour. It happens from time to time.
I was talking about an additional window helping to naviagte in a function. This would be a great feature for functions with much lines (200 and more). |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - May 26 2011 : 12:55:48 PM
|
The next time you have a problem with Alt-O, can you please see if you can reproduce it a second time, and note the full path's of the files where you are having the problem?
Do you think you ever have this problem with newly added files, or only with existing files that have been in the solution for a while?
The feature request, I see what you are talking about now. I have put in a feature request to see what our developers make of this idea:
case=57709 |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - May 27 2011 : 12:49:18 AM
|
I will try it the next time.
I had these problems with existing files that have been in the solution for a while. |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - May 27 2011 : 01:21:31 AM
|
Additional info:
I'm using VS2005 |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - May 27 2011 : 12:37:30 PM
|
I was hoping these would be new files, since it is just possible that if they are only just added to the solution, or only one of the pair of files has been added, VA would not yet know about the files, so explaining the problem with Alt-O, but obviously this is not the case.
Is it possible you are occasionally using Alt-G instead of Alt-O? The duplicate symbol names might confuse Alt-G, but I don't see how this could be confusing Alt-O. |
zen is the art of being at one with the two'ness |
 |
|
FWillen
Senior Member
  
Germany
45 Posts |
Posted - May 30 2011 : 02:41:38 AM
|
No I was definetely pressing Alt-O. By pressing Alt-G another dialog is appearing, by pressing Alt-O VA is jumping directly to the corresponding header- / cpp-file. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - May 30 2011 : 10:57:31 AM
|
Unfortunately I have no idea what to make of the Alt-O problem. Next time you notice this, can you see if you can reproduce it?
If so, then would you be able to grab a mini dump of the IDE while the problem is still happening, this FAQ entry should help here:
http://docs.wholetomato.com?W303
and then note the full path's of the problem files, and the files that Alt-O should actually be jumping between. Hopefully the mini dump will give us some idea about what VA was thinking when this went wrong. |
zen is the art of being at one with the two'ness |
 |
|
Topic  |
|