Author |
Topic  |
|
alanchen
Junior Member
 
11 Posts |
Posted - Sep 24 2014 : 12:21:50 PM
|
With Visual Assistant, is it possible for it to auto-generate a comment for a function/file or a class based on a given template? Thanks
|
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
|
alanchen
Junior Member
 
11 Posts |
Posted - Sep 25 2014 : 10:28:19 AM
|
Sorry but in my Visual Assiast, then I click "Refractor" menu, all items are disabled except for "Rename files" and "Create Files...", why?
I have already opened Visual C++ project and VA is enabled as well.
Thanks
quote: Originally posted by feline
For functions, use the Document Method command:
http://docs.wholetomato.com/default.asp?W161
For a file, you probably want to use a VA Snippet here:
http://docs.wholetomato.com/default.asp?W171
and inside the snippet you can use various reserved strings, given here:
http://docs.wholetomato.com/default.asp?W262
which lets you pick up things like the current file name, which you may well want.
I can provide more guidance if you can post some examples of what you are trying to do.
|
Edited by - alanchen on Sep 25 2014 10:29:20 AM |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
Posted - Sep 25 2014 : 2:19:16 PM
|
The available refactoring commands are effected by the location of the caret, they are context aware. This sounds like your caret is in white space. Try placing your caret into a function name, on a function declaration or implementation. Document Method should now be available. |
zen is the art of being at one with the two'ness |
 |
|
alanchen
Junior Member
 
11 Posts |
Posted - Sep 26 2014 : 7:07:01 PM
|
I have tried the feature and it works perfectly.
Two more questions:
1. Is it possible to insert the month as english apprevication? For example, Sep, Oct, instead of using the month abbrev in locale, since it is not a good practice to insert non-English language in the .cpp file.
2. Is it possible to insert the current user name? Since it is very common to add the current user as the author name in the function comment block.
Thanks |
Edited by - alanchen on Sep 26 2014 7:07:11 PM |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
Posted - Sep 26 2014 : 9:01:40 PM
|
Point 1, unfortunately no, but that is an interesting point, I have put in a feature request for this, to add reserved strings that would make this possible:
case=85291
Point 2, for the current user name, just use %USERNAME% to insert this environment variable, as explained here:
http://docs.wholetomato.com/default.asp?W262 |
zen is the art of being at one with the two'ness |
 |
|
alanchen
Junior Member
 
11 Posts |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
Posted - Sep 29 2014 : 09:04:58 AM
|
My mistake, the link Sean posted was the one I had looked up for you, but somehow I managed to post the wrong link. Hopefully this helps to explain how to use environment variables in your snippets, including Document Method. If you have any problems with this then please just ask. |
zen is the art of being at one with the two'ness |
 |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
Posted - Apr 10 2015 : 11:28:12 PM
|
case=85291 is fixed in build 2062 |
 |
|
|
Topic  |
|