Author |
Topic |
|
drac
Senior Member
Germany
49 Posts |
Posted - Jun 17 2009 : 12:06:50 PM
|
Hi,
Consider the following code:
class Figure
{
public:
virtual double Ar|ea() = 0;
};
class Square : public Figure
{
public:
virtual double Ar|ea();
};
double Square::Area()
|{
return 0.0;
}
class Circle : public Figure
{
public:
virtual double Ar|ea();
};
double Circle::Area()
|{
return 0.0;
} If the cursor is over Figure::Area and I issue Alt-G nothing happens. For Square::Area and Circle::Area issuing Alt-G works.
If I issue F12 over Figure::Area Visual Studio 2008 asks me which Area I would like to visit.
This issue is very important when working with Interfaces in C++.
Cheers! |
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Jun 17 2009 : 5:15:49 PM
|
If you run find references on Figure::Area you will get the function in the derived classes. It will list also function calls, not only function declarations/definitions, but we are considering implementing a feature to be able to filter out function callings:
case=2867 |
|
|
drac
Senior Member
Germany
49 Posts |
Posted - Jun 18 2009 : 08:12:23 AM
|
I think that Visual Assist should detect that Figure::Area is a pure virtual function when I hit Alt-G and do a find references command for me, I will not mind waiting (watching a progress bar) and then present the list of derived methods, if any.
Navigating by Alt-G is something different than find references, which requires mouse usage (or alt-x, d) and then navigating through a different window - toggling between source code and VA Find References Results is done via Alt-F6 instead of just Alt-Left.
I can live with Find References but having case where Alt-G doesn't work creates the illusion that Visual Assist is not working. |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Jun 18 2009 : 1:17:17 PM
|
I am not sure what to make of this. Firstly it is possible to give a pure abstract function a body. It may not be common, but it does compile, and it can be a very useful feature.
More generally though, you are basically saying "if there is nowhere to go for Alt-G then do a Find References instead". Currently Alt-G doing nothing tells you something useful. Do we want to "confuse" the distinction between Alt-G and Find References?
If / when there is a form of Find References to only find function declarations / implementations then it makes more sense to call this.
Are you aware you can simply bind a keyboard shortcut to the command VAssistX.FindReferences via the IDE keyboard shortcuts settings? |
zen is the art of being at one with the two'ness |
|
|
drac
Senior Member
Germany
49 Posts |
Posted - Jun 18 2009 : 3:46:02 PM
|
I think this thread belongs to "Suggestions and Ideas".
I would like Visual Assist to make a special case for pure virtual functions - which implement the notion of "interfaces" in c++.
If the pure virtual function has a body, put that definition with all the implementations of that pure virtual function.
Also it would be nice to do also the reverse, from Circle::Area definition to goto Figure::Area declaration. Useful when a class implements many interfaces and you need to find out which interface declares a function.
Regarding VAssistX.FindReferences I can say that I hate the keyboard configuration dialog in Visual Studio! You cannot resize it and you can see only five items from that list of commands.
I wish that Visual Assist would have dialog "Keyboard mapping" where you can configure only Visual Assist's functionality and a method to save this information in a simple xml,ini,json file for simple backup and restore. |
Edited by - drac on Jun 19 2009 04:56:43 AM |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Jun 22 2009 : 4:35:24 PM
|
We are considering implementing a feature which will allow Find References to search base classes as well as derived classes:
case=3346
Yes, Visual Studio's keyboard configuration window can be annoying, especially when you try to find something in the little window. I use a workaround to avoid confusion: I alway use filtering. For example when I want to configure the keys for Visual Assist refactorings (which is very useful) I just type:
vassistx.refactor
into the "show commands containig" editbox, and I get a list of the available refactorings:
VAssistX.RefactorAddInclude VAssistX.RefactorAddMember VAssistX.RefactorAddSimilarMember VAssistX.RefactorChangeSignature etc.
Or if you type vassist.findref, you get VAssist.FindReferences.
After that, you can export/import your keyboard commands and other preferences:
Tools -> Import and Export settings... |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jan 31 2010 : 1:13:41 PM
|
case=3346 is implemented in build 1810 |
Whole Tomato Software, Inc. |
|
|
|
Topic |
|