Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Auto-generate comment for a function/file or class

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
alanchen 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
9   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Apr 10 2015 : 11:28:12 PM
case=85291 is fixed in build 2062
feline 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.
sean Posted - Sep 26 2014 : 11:01:50 PM
This is the page feline meant to direct you to for environment variables:
http://docs.wholetomato.com/default.asp?W263
alanchen Posted - Sep 26 2014 : 10:28:00 PM
Seems %USERNAME% is not documented in http://docs.wholetomato.com/default.asp?W262 ? Please add it so that others can utilize this as well.
feline 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
alanchen 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
feline 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.
alanchen 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.

feline Posted - Sep 24 2014 : 9:07:53 PM
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.

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