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
 Find Symbol jumps to function prototype
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dreijer
Ketchup Master

62 Posts

Posted - Nov 06 2008 :  12:20:17 PM  Show Profile  Reply with Quote
I just downloaded the latest version of VA (1649). The project I'm currently working on declares several function prototypes in header files for use in the entire project. However, when I use the Find Symbol feature to find one of the functions, VA jumps to the header file rather than the implementation in the .cpp file. I then have to manually hit Alt+G to jump to the .cpp file.

I think this is a very counterintuitive behavior since developers are often much more interested in the actual implementation rather than the declaration. (It's sort of in the same category as http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=7109)

Is this something you might fix in an upcoming release?

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Nov 06 2008 :  4:41:14 PM  Show Profile  Reply with Quote
Normally Visual Assist ask you where do you want to go. So, for example:

class cTest {
    void Member();
};

void cTest::Member()
{
}

void Function()
{
    cTest obj;
    obj.Member();
}


Can you try this example? (Certainly you can place the class definition into a header file)
If you press Alt+G on "Member" in Function(), Visual Assist will ask you where to go. Are you seeing the same effect?

Virtual functions are different: if you have, for example a pure virtual function and a lot of derived class where you override it, Alt+G will go to the pure Virtual function in the header. But we should separate this to effect.
Go to Top of Page

dreijer
Ketchup Master

62 Posts

Posted - Nov 06 2008 :  8:10:38 PM  Show Profile  Reply with Quote
You're talking about a class method whereas I'm talking about a global function. Also, I'm talking strictly about the Find Symbol feature and not Alt+G.
I tried your example and VA correctly jumps to the implementation when I type 'cTest member'.

I did a little more testing on my own code, though, and it looks like VA gets confused if the prototype declaration isn't completely identical to the definition:

// Header file
void SomeFunc(__in const Foo& moo);

...

// Source file (notice the missing __in)
void SomeFunc(const Foo& moo)
{
}

The guy who maintained the code before me apparently didn't manage to keep his prototypes and implementations synchronized. The compiler doesn't complain, however, so it seems to me VA shouldn't either.

Edited by - dreijer on Nov 06 2008 8:14:22 PM
Go to Top of Page

dreijer
Ketchup Master

62 Posts

Posted - Nov 07 2008 :  12:02:58 PM  Show Profile  Reply with Quote
Another example is the HttpExtensionProc function prototype declared in the Microsoft header file httpext.h:

DWORD WINAPI HttpExtensionProc( __in EXTENSION_CONTROL_BLOCK *pECB );

The developer who implemented this function in his code wrote:

DWORD WINAPI HttpExtensionProc(__in LPEXTENSION_CONTROL_BLOCK pECB)
{ ... }

This is essentially the same, but VA cannot make the connection because it apparently only does a strict string comparison of types.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Nov 09 2008 :  3:26:37 PM  Show Profile  Reply with Quote
Visual Assist does not distinguish between overloaded functions, so this should not be the problem. I tried your examples and both worked for me. I tried to call your 2 example functions from an another global function, and VA offered both locations for me.

One possible reason can be for Alt+G not always find the implementation is if you have actively modified files in your stable include directories. Can you please check your stable directories here:

VA Options -> Projects -> C/C++ Directories

You should only have rarely modified files here.

Edited by - accord on Nov 09 2008 3:27:03 PM
Go to Top of Page

dreijer
Ketchup Master

62 Posts

Posted - Nov 10 2008 :  4:57:11 PM  Show Profile  Reply with Quote
quote:
Originally posted by accord

Visual Assist does not distinguish between overloaded functions, so this should not be the problem. I tried your examples and both worked for me. I tried to call your 2 example functions from an another global function, and VA offered both locations for me.

I don't see where overloading enters the pictures here.

quote:
Originally posted by accord

One possible reason can be for Alt+G not always find the implementation is if you have actively modified files in your stable include directories. Can you please check your stable directories here:

I'm not sure why you keep mentioning the Alt+G feature. This is not what I'm talking about. I'm talking about the Find Symbol dialog (Shift+Alt+S). Also, this hasn't got anything to do with my stable include directories since the files I'm talking about are being actively developed and are therefore not in that list.

I'll try to repro this on another computer as soon as possible.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Nov 12 2008 :  3:49:34 PM  Show Profile  Reply with Quote
quote:
I'm not sure why you keep mentioning the Alt+G feature. This is not what I'm talking about. I'm talking about the Find Symbol dialog (Shift+Alt+S).


Sorry, I missed that

I am seeing the same effect here. Thank you for the clear description.

case=20885
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