Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Copy type of function parameter to clipboard

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
joostn Posted - Mar 17 2015 : 07:20:24 AM
Perhaps this is also worth considering: being able to copy the fully expanded type name of a parameter to a function.

Suppose I have this class:

template <class T>
class TThing
{
  void DoSomething(int i, std::shared_ptr<std::vector<T> > vec);
};


Now when I start typing:
TThing<bool> mything;
DoSomething(5,

it would be nice to be able to paste the fully expanded type of the function parameter:
std::shared_ptr<std::vector<bool> >
because I might need to declare a temporary object of this type prior to calling DoSomething.

Or perhaps for simplicity just a 'copy function signature to clipboard' feature: when right clicking on DoSomething this would copy the function signature (with all templates fully expanded):
void DoSomething(int i, std::shared_ptr<std::vector<bool> > vec)
so I can cut/paste from this manually.

This might be complicated if a function is overloaded, but even if it would only work for non-overloaded functions this would be useful.
5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 19 2015 : 5:41:48 PM
I am glad this is helping, thank you for the update. This bug will be studied in the other thread, this keeps things separate and a bit easier to track
joostn Posted - Mar 19 2015 : 04:10:35 AM
Hi Feline,

It's definitely a bug, I'm also encountering problems when refactoring this code.
But please consider my original feature request closed, the VA definition window is a perfect solution to my problem.

I've posted a new bug report here:
http://forums.wholetomato.com/forum/topic.asp?TOPIC_ID=12231
feline Posted - Mar 19 2015 : 12:27:35 AM
Do you have much code like this?

Have you considered using the "auto" keyword, to get hold of complex types without to much difficulty?
joostn Posted - Mar 18 2015 : 10:18:38 AM
That's very useful! I hadn't found this yet. Thanks.

It doesn't work however for this case (http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern):
template <class T>
class BBB
{
};

template <class T>
class AAA  : public BBB<AAA<T> >
{
public:
  inline AAA(){}
  inline T GetValue() const
  {
    return (T)0;
  }
};

void test()
{
  AAA<double> d;
  d.GetValue();
}


If I click on d.GetValue() the VA definition stays empty.
If i remove the public BBB<AAA<T> > inheritance it works.
feline Posted - Mar 17 2015 : 11:11:46 PM
Place the caret into the function call "mything.DoSomething()" and look at the VA definition field, which is normally at the top of the editor, on the right hand side. For the test code:

TThing<bool> myThing;
myThing.DoSomething()

VA is giving me:

void DoSomething(int i, std::shared_ptr<std::vector<bool> > vec)

you can place focus into the definition field, and copy this expanded signature from there into the clipboard, or just select and copy the part that you want.

For overloaded functions, use the pull down arrow at the end of the definition field, to see the different overloads that VA knows about. I think this does what you are looking for.

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