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
 VA 1437 "go to definition" bug
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic   

sth4nth
Junior Member

18 Posts

Posted - Dec 15 2005 :  08:28:54 AM  Show Profile  Reply with Quote
//str
string str;
str.c_str();

when I put the cursor on str on line 3, then click the "go" button to navigate to the definition, the cursor will jump to line 1 not line 2;
The same thing will happen to following code:
"sth";
string str;
str.c_str();

sth4nth

support
Whole Tomato Software

5566 Posts

Posted - Dec 15 2005 :  5:52:55 PM  Show Profile  Reply with Quote
We try your example with 1437 inside VS.NET 2003 and Goto leaves the caret at line 2.

Can you reproduce the problem in a small file? Near the top of your current file? (Maybe something in the current file gets the VA X line count off by one.)


Edited by - support on Dec 15 2005 5:59:18 PM
Go to Top of Page

sth4nth
Junior Member

18 Posts

Posted - Dec 18 2005 :  02:25:59 AM  Show Profile  Reply with Quote
//str

string str;
str.c_str();

Here, I mean some string in the comment is the same with a variable name("str" above), Then the "go to" will jump to the comment line.

I guess the error is caused by jumping to the first place that "str" appear in the file.

sth4nth
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Dec 18 2005 :  10:25:45 AM  Show Profile  Reply with Quote
Jumping to the "first place that str appears" not something VA X would do. VA X is usually quite smart.

We tested your example again and understand what is happening. VA X assumes the comment describes str so it assumes you want to go there.

VA X will not take you to a comment with str outside the scope of str.

Try Goto on each str in the following example, then change the comment lines to see the VA X is still doing the right thing.

Go to Top of Page

sth4nth
Junior Member

18 Posts

Posted - Dec 19 2005 :  02:53:29 AM  Show Profile  Reply with Quote
but if I have such code:
// "hello"
....

string hello;
....


hello.c_str();

when I click the "go to", I want to go to the definition. "hello" in the comment maybe for other purpose not for the variable hello.

sth4nth
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Dec 19 2005 :  3:54:44 PM  Show Profile  Reply with Quote
the problem here is that VA has no way of knowing absolutely if the comment applies to the variable or not, so it is making its best guess. can you not change the case of the words in the comment?

using support's example if i change the innermost comment to read // Str then goto now goes to the definition of the variable, since the comment no longer matches the variable.

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

sth4nth
Junior Member

18 Posts

Posted - Dec 20 2005 :  09:24:00 AM  Show Profile  Reply with Quote
Here is a example:

string strPath=strDir+"model";
....
....

CModel model;
...

model.dosth();


if I click "go to", it will jump to the first line of the code which definitely have no relation to the variable model.

sth4nth
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Dec 20 2005 :  3:17:09 PM  Show Profile  Reply with Quote
now i understand the problem.

case=938

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic   
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000