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
 Feature Requests
 finds reference to member function in base class
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

eve
Tomato Guru

Belgium
101 Posts

Posted - Oct 26 2006 :  04:41:39 AM  Show Profile  Reply with Quote
Hi,

I would like to suggest a feature for VAX:

sometimes I want to do a 'find references' on a member function, but if you do that on a re-implemented function you only get the references to the reimplemented function, and not the references to the original function, while I'm actually looking for all re-implementations of that function.

I see 2 solutions to solve this:
- Add an option to jump to the definition of the member function that was re-implemented, so I can do a 'find references' from there.
- Allow to do a 'find references' that includes the references to the function in the base class. This was the behaviour in one of beta builds, but was (correctly) removed due to a bugfix.

thanks,
eli

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Oct 26 2006 :  3:54:47 PM  Show Profile  Reply with Quote
Using VS2003 and VA 1539, if I do a Find References for a virtual function in a base class then all instances where it is re-implemented in derived classes are found. Obviously this requires getting to the base class before doing the find.

The reason it works this way is because Find References is also used by rename. If we try to rename all instances in the base class you have to stop and think about multiple inheritance and using a stable include (perhaps 3rd party library) class as the base class.

Asking Find References to behave differently when used manually, which is the obvious "solution", still leaves the twin problems of multiple inheritance (what are you trying to scan) and people who are deriving classes from core or 3rd party library classes. Suddenly you have to scan a lot more code than you do currently.

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

eve
Tomato Guru

Belgium
101 Posts

Posted - Oct 27 2006 :  02:47:55 AM  Show Profile  Reply with Quote
I agree to all of this, but maybe a two-step workaround is to provide a way to get to the base class that contains the virtual function. From there a 'find references' will do the job.

Or something like a smarter 'Goto definition': currently it shows almost all functions with the same name, it would be great to have a list of all functions that also inherit/are inherited from a certain function.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Oct 27 2006 :  07:04:16 AM  Show Profile  Reply with Quote
Do you use the HCB?

http://www.wholetomato.com/products/features/hcb.asp

Hovering the mouse over the function you want to find will show you the class this function belongs to. At the bottom of the HCB you will find the base class. The functions of the base class are listed underneath it. Double clicking on the base class name, or the function name will take you there.

FSIW is another quick way of finding the base class function.

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

eve
Tomato Guru

Belgium
101 Posts

Posted - Oct 27 2006 :  07:15:51 AM  Show Profile  Reply with Quote
The problem with HCB is that it show me all base classes. Often our classes implement multiple interfaces and I want to find out from which interface a function is implemented.
The problem with FSIW is that it is a simple filter: functions with the same name in a totally different context are also shown.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Oct 27 2006 :  10:08:47 AM  Show Profile  Reply with Quote
I am starting to understand the problem.

You can do fairly complex filters in FSIW.

http://www.wholetomato.com/products/features/siw.asp

Use space to seperate the words, and all of them have to turn up. You can also put a minus sign in front of a work to remove all references to that word. So you could use the filter paint base -child to see all functions containing "paint" in any class containing "base" while excluding any class containing "child".

Which IDE and language are you using? I am wondering if something else already in the IDE might help.

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

eve
Tomato Guru

Belgium
101 Posts

Posted - Oct 30 2006 :  02:28:09 AM  Show Profile  Reply with Quote
I'm using VC2003, but will switch this week to VC2005.
Most of our code is C++, but some of it was originally C.

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Oct 30 2006 :  09:47:18 AM  Show Profile  Reply with Quote
You may find typing the start of the function name with focus in the HCB helps, as discussed here:

http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=5537

In VS2003 have you tried "right click -> Go To Definition" or "Go To Declaration"? It tends to be slower than VA's alt-g, but in my initial tests it is suggesting the virtual function in both the base and derived classes, since it cannot work out which one I want.

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

eve
Tomato Guru

Belgium
101 Posts

Posted - Oct 30 2006 :  09:58:12 AM  Show Profile  Reply with Quote
Actually, the Go To Definition was what made me post this suggestion: I wanted a goto definition that was smart enough to show me what the base function is and what the derived functions are, and filter out all functions that have nothing to do with the function I clicked on.
By the way: do you happen to know why the 'Go To Definition' is so slow? It does not use CPU nor disk access...

I don't think your trick with the End button in the HCB will work: my classes often derive from a few interfaces, and I want to find out from which interface my function is implemented. Pressing End just brings me to the last interface, without any guarantee that it contains the function I am looking for.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Oct 30 2006 :  1:35:43 PM  Show Profile  Reply with Quote
I have no idea why 'Go To Definition' is so slow, I just put it down to the IDE being slow in places.

The End button in the HCB, I was talking about expanding each of the interface classes in turn. Typing in the HCB will only jump to a visible item, so if the function is in one of the collapsed interfaces then you will not see it. If you only have two or three interfaces then it is quite fast to expand them with they keyboard or mouse. Having done this you can type the name of the function.

Thinking about my own virtual functions, the classes involved tend to have similar names. Do your interface classes have similar names, preferably a common part of the name? If so you could use FSIW and filter on the common interface name part + the name of the function.


Rename does not try to scan all of the base classes, for sensible reasons. However any enhanced form of alt-g is going to run into exactly the same problems, and sea of edge cases. This is why I am focusing more on finding a reasonable alternative plan than putting in a feature request.

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

eve
Tomato Guru

Belgium
101 Posts

Posted - Oct 31 2006 :  03:06:59 AM  Show Profile  Reply with Quote
I appreciate your effort to find an alternative, although I must say that this is not something I can't live without. It's just something that I could use now and then. If it is too hard to implement, then I guess you rather spend your development time on something else.

I'm still not convinced about the HCB window: the classes I'm speaking of implements 18 interfaces (don't start about the design ;-).
And no, the functions do not have a common part in there name.

thanks for your help.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Oct 31 2006 :  08:41:08 AM  Show Profile  Reply with Quote
18 interfaces, yep, so much for the cunning plan to find a work around.

Since this question has now come up in 3 separate threads I have put in a feature request to get the developers feedback on this. However this does not mean we will actually try and do this.

case=3346

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

eve
Tomato Guru

Belgium
101 Posts

Posted - Oct 31 2006 :  08:50:03 AM  Show Profile  Reply with Quote
good try though

- Have you got a plan my lord?
- Yes I have, and it's so cunning you can brush your teeth with it.

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Oct 31 2006 :  08:57:37 AM  Show Profile  Reply with Quote
Once you move to VS2005 you *may* get some joy from the class browser feature. However this almost certainly requires leaving the IDE's intellisense enabled.

If you are using a fairly large C++ solution you may decide you are better off disabling the intellisense and just using VA instead

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

support
Whole Tomato Software

5566 Posts

Posted - Jan 31 2010 :  1:17:08 PM  Show Profile  Reply with Quote
case=3346 is implemented in build 1810

Whole Tomato Software, Inc.
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