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
 Access to a variable's type in template expansion
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

borgman
New Member

8 Posts

Posted - Mar 10 2007 :  5:28:19 PM  Show Profile  Reply with Quote
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  Show Profile  Reply with Quote
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$).
Go to Top of Page

borgman
New Member

8 Posts

Posted - Mar 12 2007 :  3:41:38 PM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 12 2007 :  4:06:43 PM  Show Profile  Reply with Quote
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
Go to Top of Page

borgman
New Member

8 Posts

Posted - Mar 12 2007 :  5:21:22 PM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 13 2007 :  08:23:23 AM  Show Profile  Reply with Quote
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
Go to Top of Page

borgman
New Member

8 Posts

Posted - Mar 13 2007 :  7:59:19 PM  Show Profile  Reply with Quote
Feline,

Thanks tons ... could we get both?

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

-Lee
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 14 2007 :  10:02:34 AM  Show Profile  Reply with Quote
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
Go to Top of Page

borgman
New Member

8 Posts

Posted - Mar 14 2007 :  12:07:51 PM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 14 2007 :  1:50:27 PM  Show Profile  Reply with Quote
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
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