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
 Function definitions in cpp file named diffrerent
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ondrej Spanel
Senior Member

40 Posts

Posted - Jul 30 2004 :  06:50:45 AM  Show Profile
For very long time I was experiencing problems with Go To Definition in my project, but I was not able to find any common ground for them or to reproduce them in a small test case until now.

The problem is Goto definition seems not to able to find a defintion if the .cpp file is named differently from a .hpp file where the fucntion was defined. Such situation is quite common in my project and I often have to use built-in Goto definition instead, which is not convenient at all. Strange thing is that after using built-in Goto, VAX sometimes seems to cath-up somehow and it will find the very same definition on next attemp. (I have "Parse all files when opening a project" toggled on, but it does not seem to help).

I attach a small example:

classDef.hpp:

#ifndef _CLASS_DEF_HPP
#define _CLASS_DEF_HPP

class SomeClass
{
  public:
  void FunctionInFileClassDef(); /// goto definition works
  void FunctionInFileClassExtend(); // goto defintion does not work
};

#endif


classDef.cpp:

#include "classDef.hpp"

void SomeClass::FunctionInFileClassDef()
{
}

int main()
{
  return 0;
}


classExtend.cpp:

#include "classDef.hpp"

void SomeClass::FunctionInFileClassExtend()
{
}

support
Whole Tomato Software

5566 Posts

Posted - Jul 31 2004 :  12:05:19 AM  Show Profile
Which Goto works and which doesn't? The Goto button next to our Definition field is ours, ie from VA X. The one in the context menu, aka Right Click in the source window, is from the IDE.
Go to Top of Page

Ondrej Spanel
Senior Member

40 Posts

Posted - Aug 03 2004 :  03:53:27 AM  Show Profile
VAX Goto (activated with Alt-G) does not work. Context menu Goto (IDE one) aleways works.

My config:

IDE: VS .NET 2003

VAX (private data removed):

VA_X.dll file version 10.0.1240.0
VAOpsWin.dll version 1.0.0.44
DevEnv.exe version 7.10.3077.0
msenv.dll version 1.0.5849.1
Font: Courier New 13(Pixels)
Comctl32.dll version 5.82.2800.1106
WindowsNT 5.1 Build 2600 Service Pack 1
2 processors

Platform: Win32

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 04 2004 :  7:01:41 PM  Show Profile
confirmed with VAX 1246 and VS .NET 2002

and i think i know what is happening. adding these three files to an existing project (commenting out the main function) VA View lists the two member functions.

switching to main.cpp, the only other file in my project, double clicking on FunctionInFileClassDef() jumps to the cpp file.

in contrast, while in main.cpp double clicking on FunctionInFileClassExtend() jumps to its line in the hpp file. so, when using VAX's goto feature from the hpp file you are probably jumping to the current line.

as you say, right click and go to definition works.

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

support
Whole Tomato Software

5566 Posts

Posted - Aug 06 2004 :  09:30:54 AM  Show Profile
VA X parses all headers and open source files when you open a project. VA X does not necessarily parse all cpp files. For this reason, which is done for performance, VA X sometimes cannot find an implementation. Most often, it cannot find an implementation in source files not named similarly to headers, eg foo.h and foo.cpp, and in source files not yet opened.

We will change VA X so it is more aggressive about parsing unopened source files and hence, about finding implementions.

case=199
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Oct 04 2004 :  5:41:51 PM  Show Profile
Fixed in build 1272.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000