Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Access to a variable's type in template expansion

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
borgman Posted - Mar 10 2007 : 5:28:19 PM
I use a lot of templates and typedef everything.
typedef std::vector< std::string, std::map< DWORD, std::string > MyDefinition;

Then use that definition:

class MyClass
{
MyDefinition m_myDefinition;
};

I would *REALLY* like it if your template expansion had access to a variable's type:

for ( $VariableType$::const_iterator iter = $selection$.begin(); iter != $selection$.end(); ++iter )
{
iter->$end$
}
9   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 14 2007 : 1:50:27 PM
I have put in a feature request for these shortcut keys:

case=5495

The new autotext value will be getting and using the same information.
borgman Posted - Mar 14 2007 : 12:07:51 PM
Feline,

Sorry for the confusion, but my keyboard accelerator request was to get to the "VA_MinihelpDefinition" combo I mentioned earlier.
And add the "$ValueType$" template substitution would be the value from that combo box.

-Lee
feline Posted - Mar 14 2007 : 10:02:34 AM
I don't understand the request. If you enter an autotext item that has prompts then you can easily navigate and use the prompt dialog with the keyboard. Tab and Shift-Tab move you through the fields, Enter accepts the dialog, and CTRL-SHIFT-V to open the clipboard history when you are in a given field.

We cannot simply add keyboard shortcuts for the combo boxes, since the name of the combo box is "unknown", it varies all of the time, depending on the autotext rule you are using.

To trigger autotext on selected text with the keyboard use the IDE to map a keyboard shortcut to the command VAssistX.InsertAutotext
borgman Posted - Mar 13 2007 : 7:59:19 PM
Feline,

Thanks tons ... could we get both?

1) Keyboard accelerater to get to those combo boxes
2) $ValueType$ template keyword

-Lee
feline Posted - Mar 13 2007 : 08:23:23 AM
That makes sense. I have put in a feature request for this:

case=5472
borgman Posted - Mar 12 2007 : 5:21:22 PM
Feline,

Yes, I had seen your earlier writeup regarding the auto text in templates, but as I understand it, the $vector_type$ substitution in the template text is not one that VA "knows about" and would initiate a prompt to the developer to fill in the type.

That said, it would be better, faster and less error prone if VA (which already knows the Type) filled that in for me.

And yes, I know that the VA wizard bar has exactly the info I need (I've been trying unsuccessfully to get it with hardcore Windows calls such as GetWindowText). However, since there is no keyboard accelerator available, I have to use my mouse to set focus to it making it impossible to create a VB macro to get it for me.

-Lee
feline Posted - Mar 12 2007 : 4:06:43 PM
It is not a direct answer, but I tackled a similar question, standard code for using STL lists, here:

http://docs.wholetomato.com?W264

Are you aware that you can place focus into VA's wizard bar manually, and thus copy / paste the text?
borgman Posted - Mar 12 2007 : 3:41:38 PM
Sean,

I gave one (admittedly poor) example in the original message where I could use the datatype to assist template expansion for STL iteration. Other examples might include creating new variable definitions or parameter substitutions. STL is wordy but mostly boilerplate where much of it relies on the Type of the variable in question.

VA presently displays in the "VA_MinihelpDefinition" combo box the datatype of the variable on which the cursor is located. I have tried without success to get the same information from the Visual Studio extension mechanism.

If that value were available or that combo box could be navigated to via keyboard then I could hack something together with IDE macros and the clipboard.

-Lee
sean Posted - Mar 10 2007 : 6:46:19 PM
Can you give an example of where you would use this expansion rule?

How would $VariableType$ be inferred?

If you are implementing a method on MyClass, how could $VariableType$ be bound to a member of the class?

It seems like the best you can hope for is the autotext definition you posted (with a runtime prompt for $VariableType$).

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