Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Replace 'auto' by actual type

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
Jan Posted - Dec 12 2018 : 4:16:37 PM
Often I want to be explicit in code which exact type is being used, but I'd like the IDE to help me figure it out and type it for me. 'auto' does pretty much all of that for me, except that it takes away the explicitness.

It would be perfect if I could just type


auto a = someFunc();


then point at the 'auto' and let Visual Assist replace it by whatever type was deduced, so that I get the actual non-auto C++ code


SomeComplicatedType* a = someFunc();


Cheers,
Jan.
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Dec 12 2018 : 5:08:02 PM
Yes, the proper action is the feature that we are considering adding. For now this is just a helpful work around.
Jan Posted - Dec 12 2018 : 4:57:39 PM
That's actually already quite useful, I hadn't even noticed that. Thanks!

A proper action would of course allow me to bind this to a shortcut (and make it discoverable from a context menu).
feline Posted - Dec 12 2018 : 4:51:35 PM
We are considering adding a command to do this:

case=79735

For now, if you place the caret into the "auto" keyword or the variable name, and look at the VA Context and Definition fields, which are normally shown at the top of the editor window, and are where the alt-m list is shown coming from, VA will show the actual type it has worked out here. You can then place keyboard focus into the definition field and copy out the type, if you want. Not quite the same, but helpful all the same.

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