Author |
Topic |
|
sjaffe
Ketchup Master
USA
60 Posts |
Posted - Jan 11 2007 : 5:41:05 PM
|
I believe that using 1541 if I typed Alt-G on the constructor in the class definition, it would jump to the implementation in the .cpp file. Now in 1543 it jumps to the top of the class definition. If I type Alt-G on the constructor implementation, I get a pop-up that asked if I want the .cpp or .h for this, but I'm already at the .cpp implementation! Sometimes I only see the file name in the pop-up (no prototype). I believe this was working correctly in the 1541.
Stan |
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 12 2007 : 12:20:27 PM
|
I have used the following C++ code:
in the header file:
class testAltG
{
testAltG();
};
and in the cpp file:
testAltG::testAltG() { }
and I am not seeing any difference in alt-g between VA 1541 and 1544. I am sitting in the cpp file, placing the caret in the function name and alt-g takes me to the header file, and to the declaration of the constructor.
Is this what you are doing, or are you doing something different? |
zen is the art of being at one with the two'ness |
|
|
sjaffe
Ketchup Master
USA
60 Posts |
Posted - Jan 12 2007 : 12:28:30 PM
|
On a class/constructor pair I picked at random, when I am in the cpp file and place the caret on the constructor method name (not the class scoping), I get a pop up with three entries: the first is the cpp where I am, the second is the line in the header file in the class where the constructor is declared, then there is a third entry that is also the same header file, but is about thirty lines above this. The popup for this third entry only shows the file name and ends up in a unrelated class definition above the correct one.
Alt-G from the class definition of the constructor (in the header file) yields a popup with the correct cpp file entry, but also the bogus header file line as described above. |
Art is the zen of being one too
Stan |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 12 2007 : 3:19:02 PM
|
Are you seeing this problem with any other classes, or just this one?
It sounds like something in the header file is confusing VA, since I am not sure where else this extra entry would have come from. |
zen is the art of being at one with the two'ness |
|
|
sjaffe
Ketchup Master
USA
60 Posts |
Posted - Jan 12 2007 : 3:27:55 PM
|
I am seeing this problem in more than one file. |
Art is the zen of being one too
Stan |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 15 2007 : 08:20:24 AM
|
Do you have time to create a new C++ console project and add a copy of cpp and .h file that show this problem to the new project to see if you get the same problem?
If you do I am wondering if you would be able to strip the files down to the point where you would be able to email me a copy so I can run the same test here.
Is this problem class forward declared? Is it a template class?
I am just trying to think of anything that might help explain this odd behaviour. |
zen is the art of being at one with the two'ness |
|
|
sjaffe
Ketchup Master
USA
60 Posts |
Posted - Jan 16 2007 : 7:34:46 PM
|
I created a console app project/workspace and copied one of the offending cpp/h file pairs into it. I am getting similar behavior (still not right). Alt-G on the cpp implementation displays a pop-up with both the h and cpp entries (should just jump to the header (class definition)). Alt-G on the header (class definition constructor) takes me to the cpp file implementation (correct). |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 17 2007 : 11:58:54 AM
|
I have the code files, thank you for this.
case=4586
One oddity, if I edit the code to try and simplify it further this alt-g menu goes away. After undoing the edit, so I am back to the original code the alt-g menu will not reappear. But I am not seeing any sign of strange control characters in this code, or anything else to explain this effect.
In the first post to this thread you suggested this bug was new. Do you know which version of VA you were using before? I am seeing this menu appear with VA 1540, so it does not seem to be new in the last couple of builds. |
zen is the art of being at one with the two'ness |
|
|
sjaffe
Ketchup Master
USA
60 Posts |
Posted - Jan 17 2007 : 12:04:01 PM
|
Sorry, I don't have the exact build, but probably not older than 1534. |
Art is the zen of being one too
Stan |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 17 2007 : 3:06:41 PM
|
To try and find out if this is a recently introduced bug I have tested the test project from you with the following versions of VA:
1540, 1539, 1538, 1537, 1536, 1535, 1530, 1446
I am seeing this menu with every single one of these builds. |
zen is the art of being at one with the two'ness |
|
|
sjaffe
Ketchup Master
USA
60 Posts |
Posted - Jan 17 2007 : 3:19:45 PM
|
But you are seeing the problem. I thought it was recently introduced because I didn't recall having seen this in previous builds. |
Art is the zen of being one too
Stan |
|
|
sjaffe
Ketchup Master
USA
60 Posts |
Posted - Jan 17 2007 : 4:01:33 PM
|
Did a little more testing (builds 1533 and 1543). Both of these have the same problem: the line numbers are not aligning properly. If I Alt-G on the cpp constructor implementation I get a cpp entry and sometimes two header file entries. The line numbers are wrong, most times off by a couple of lines, but sometimes so far off they put me in an entirely unrelated method (in the cpp file). The problem looks similar to Topic 5782 (case 784), related to enum lines being wrong. The pop-up line number and the class browser line numbers are the same.
I am speculating that when Alt-G is pressed, if there is more than one place to go, you get a pop-up, but if there is only one place to go, it just jumps there. In my test case, there was only one place to go, but I got a pop-up because the line numbers were wrong. The VAX code that determined if a pop-up should be displayed tested true because it looked like the current line number was different from the pop-up line number (because it's wrong). If the pop-up line number was correct, I wouldn't get the pop-up because I'm already on that line in the cpp file; it would just jump to the header file line. Is that possible? |
Art is the zen of being one too
Stan |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 17 2007 : 5:44:07 PM
|
I am not sure what is going on under the hood in this case, but for me the effect is very fragile. It is easily reproduced in your sample project, but if I edit the code even slightly alt-g just takes me directly to the header file. |
zen is the art of being at one with the two'ness |
|
|
sjaffe
Ketchup Master
USA
60 Posts |
Posted - Jan 17 2007 : 6:50:24 PM
|
I have confirmed the problem seems to be when a constructor has an initializer list on a separate line below the constructor, then an open brace:
foo::foo() : x(3) { ...
If you remove the initializer list it works correctly. |
Art is the zen of being one too
Stan |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 18 2007 : 10:05:28 AM
|
If only it was that easy for me
I removed the namespace and the problem went away. I then undid the edit in the IDE, so I was back to the original code, and alt-g just worked, taking me directly to the header file.
So some of the time your code shows the bug and some of the time the exact same code does not show the bug. I spent ages chasing that one in circles just to make sure I was not imagining this. The effect, for me, in my test project, is all to real, and confirmed in two different IDE's. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|