Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Find Symbol jumps to function prototype

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
dreijer Posted - Nov 06 2008 : 12:20:17 PM
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?
6   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Nov 12 2008 : 3:49:34 PM
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
dreijer Posted - Nov 10 2008 : 4:57:11 PM
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.
accord Posted - Nov 09 2008 : 3:26:37 PM
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.
dreijer Posted - Nov 07 2008 : 12:02:58 PM
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.
dreijer Posted - Nov 06 2008 : 8:10:38 PM
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.
accord Posted - Nov 06 2008 : 4:41:14 PM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000