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
 goto definition for auto std::shared types
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MrJones4u
Ketchup Master

81 Posts

Posted - Aug 13 2018 :  07:11:20 AM  Show Profile  Reply with Quote
Hello,

I often find myself wondering why I cannot simply go the the class definition of an object that has been defined by an auto, when using shared_ptrs.

In this case clicking ALT-G on the auto leads to an dead end somewhere in the stl memory include...



thanks,
Michael



feline
Whole Tomato Software

United Kingdom
18721 Posts

Posted - Aug 13 2018 :  08:57:24 AM  Show Profile  Reply with Quote
If you try Alt-Shift-G, which should bring up:

VAssistX -> Goto Related

this should offer the type inside the pointer, as well as the pointer type its self. You are asking VA to go to the definition of the type, but the main type is the shared pointer container. As soon as more than one type is involved, you always have this question of "which type do you mean", so Goto Related just tries to list all of the types, so you can decide which one it is you want to go to.

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

MrJones4u
Ketchup Master

81 Posts

Posted - Aug 14 2018 :  03:49:06 AM  Show Profile  Reply with Quote
Hallo,

thanks for the pointer, I was not actually aware of this option :-).
Yet, while valid, this is still a really long winding way to do such a frequent operation - auto, std::shared and such are sort of here to stay for a while...

cu,
Michael

Edited by - MrJones4u on Aug 14 2018 03:55:51 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18721 Posts

Posted - Aug 14 2018 :  06:46:19 AM  Show Profile  Reply with Quote
They are, but where do you draw the line? If we apply a different rule just for the STL containers, then anyone using Boost will still have this problem. What about template classes in general? Sometimes you want the template, and sometimes you want one of the types the template is handling.

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

MrJones4u
Ketchup Master

81 Posts

Posted - Aug 14 2018 :  06:59:22 AM  Show Profile  Reply with Quote
..yes, my thoughts exactly - what with templates with multiple classes - a spiral decent into madness :-)

But that was why I included the picture above - what if we could click on the displayed elements e.g. when I click on the class name I get options for that classname?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18721 Posts

Posted - Aug 14 2018 :  08:02:37 AM  Show Profile  Reply with Quote
Isn't this what Alt-Shift-G is giving you? It should, so if it isn't then this is something that needs looking into. Basically this is exactly the sort of situation that Goto Related is designed to handle.

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

MrJones4u
Ketchup Master

81 Posts

Posted - Aug 14 2018 :  08:10:22 AM  Show Profile  Reply with Quote
Not really, ALT-Shift-G gives me a two level menu with inconsistent, aka must read no blind fly, menu entries which may or may not contain the desired entry - whereas the normal informational pop-up generally clearly displays the desired aspects of the item I am hovering above- It also clearly displays that the code knows how the item is constructed as it is not a code copy but a (re) assembly of the type. As I can actually click into the pop.-up without it twiching it is currently "wasted real estate" :-)

cu,
Michael
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18721 Posts

Posted - Aug 14 2018 :  12:44:22 PM  Show Profile  Reply with Quote
Sometimes the tooltip is coming from the IDE, sometimes it will be coming from the IDE. So immediately this gets a bit more tricky. Next there is the problem that as soon as the tooltip stays put when you move the mouse to click on it, this will upset people who don't want to have the tooltip "stuck" on the screen in the way.

The Alt-Shift-G menu -> Types of Symbol sub-menu is designed to group the types into the hierarchy that they are using, to make it easier to understand what is holding what. A slightly more complex code sample showing this in action happens with:

std::shared_ptr<std::map<FoodData, testForwardDeclareOffered> > severalTypePtr;
auto testingRelated = severalTypePtr;

zen is the art of being at one with the two'ness
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