Author |
Topic |
|
borgman
New Member
8 Posts |
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$ } |
|
sean
Whole Tomato Software
USA
2817 Posts |
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$).
|
|
|
borgman
New Member
8 Posts |
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 |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
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? |
zen is the art of being at one with the two'ness |
|
|
borgman
New Member
8 Posts |
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
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Mar 13 2007 : 08:23:23 AM
|
That makes sense. I have put in a feature request for this:
case=5472 |
zen is the art of being at one with the two'ness |
|
|
borgman
New Member
8 Posts |
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
Whole Tomato Software
United Kingdom
19020 Posts |
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 |
zen is the art of being at one with the two'ness |
|
|
borgman
New Member
8 Posts |
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
Whole Tomato Software
United Kingdom
19020 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|