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
 Technical Support
 Doxygen Function Header - Follow up question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shawn1874
New Member

USA
6 Posts

Posted - May 10 2017 :  2:41:34 PM  Show Profile  Reply with Quote
https://forums.wholetomato.com/forum/topic.asp?TOPIC_ID=10401&SearchTerms=Doxygen

My question is based on the above thread. The final commenter wasn't sure if the tags should be auto-filled. I would think that is the point of putting tags into the snippet so that the function declaration is parsed to get the param names and return type. My experience thus far is that VA just pops up a dialog where you enter it. Am I missing something? Other tools like atomineer have the ability to grab the param names and return type automatically when documenting a function. I don't really want to have to buy so many different tools though so I hope that I am just misunderstanding how to set this up with VA.

I'm also stuck with visual studio 6.0 for now so I wonder if it works better with newer versions of visual studio.

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - May 11 2017 :  12:08:29 PM  Show Profile  Reply with Quote
First up, are you using the Document Method refactoring command, or are you triggering a snippet by typing its shortcut into the editor, or selecting it from a menu?

If you trigger the Document Method snippet, then you can set this to enter the method name, its return type, the parameters, and specify the comment structure you want to use.

For example, the Document Method snippet:

//************************************
// Method:    $SymbolName$
// FullName:  $SymbolContext$
// Access:    $SymbolVirtual$$SymbolPrivileges$$SymbolStatic$
// Returns:   $SymbolType$
// Qualifier: $MethodQualifier$
// Parameter: $MethodArg$
//************************************


will expand all of the $$ tokens above when Document Method is triggered on a method, and the Parameter comment line will be repeated for each parameter the function takes.

This works perfectly well in VC6, so if you can explain what you are doing, I can try to help you get this working correctly.

zen is the art of being at one with the two'ness
Go to Top of Page

shawn1874
New Member

USA
6 Posts

Posted - May 11 2017 :  12:47:34 PM  Show Profile  Reply with Quote
Thanks. I believe that I setup a brand new snippet, and tried to copy and paste an existing doxygen snippet. I have noticed that those special keywords work for the document method but why does it not work if I try to format the comment block in doxygen style? Is there a specific way of creating a new snippet that allows that to work?

quote:
Originally posted by feline

First up, are you using the Document Method refactoring command, or are you triggering a snippet by typing its shortcut into the editor, or selecting it from a menu?

If you trigger the Document Method snippet, then you can set this to enter the method name, its return type, the parameters, and specify the comment structure you want to use.

For example, the Document Method snippet:

//************************************
// Method:    $SymbolName$
// FullName:  $SymbolContext$
// Access:    $SymbolVirtual$$SymbolPrivileges$$SymbolStatic$
// Returns:   $SymbolType$
// Qualifier: $MethodQualifier$
// Parameter: $MethodArg$
//************************************


will expand all of the $$ tokens above when Document Method is triggered on a method, and the Parameter comment line will be repeated for each parameter the function takes.

This works perfectly well in VC6, so if you can explain what you are doing, I can try to help you get this working correctly.

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - May 11 2017 :  1:26:53 PM  Show Profile  Reply with Quote
What VA snippet are you editing?
What are you setting it to?
Can you post a sample function declaration that you are triggering Document Method on, and the comment that VA is then inserting for you?

Using VC6, VA 2217 under Windows 7, I have set the Snippet "Refactor Document Method" to the code:

/*
 * @method $SymbolName$
 * @FullMethod $SymbolContext$
 * @access $SymbolVirtual$$SymbolPrivileges$$SymbolStatic$
 * @return $SymbolType$
 * @qualifier $MethodQualifier$
 * @parameter $MethodArg$
 */


and then I triggered Document Method on the function:

static void simpleVc6DoxygenFormatTest(int nParamOne, int nParam2);


which produced the following comment block:

/*
 * @method simpleVc6DoxygenFormatTest
 * @FullMethod simpleVc6DoxygenFormatTest
 * @access public static 
 * @return void
 * @qualifier
 * @parameter int nParamOne
 * @parameter int nParam2
 */
static void simpleVc6DoxygenFormatTest(int nParamOne, int nParam2);


I have just guessed at the correct formatting and tag names for Doxygen comments, since as I recall there are at least 2 different supported formats, and many possible tags. However, as you can see, this is working perfectly well for me here. So I am wondering what I am doing differently to you.

zen is the art of being at one with the two'ness
Go to Top of Page

shawn1874
New Member

USA
6 Posts

Posted - May 11 2017 :  1:34:47 PM  Show Profile  Reply with Quote
Attached is the pop-up I get when I try to insert the snippet. I tried duplicating the snippet that you referred to for documenting methods, and then I just changed it to look like Doxygen. For some reason it just doesn't work the same way as the original and I don't know why.



here is the text of the snippet that I am trying.

/**
*
* @param $MethodArgs$
* @return $SymbolType$
*/

Here is the picture of the data entry window too if that helps at all.




Go to Top of Page

shawn1874
New Member

USA
6 Posts

Posted - May 11 2017 :  1:50:02 PM  Show Profile  Reply with Quote
Although I posted separate responses with the information you asked for, I think I see the difference now. You are simply editing the existing refactor method snippet, whereas I am creating a new snippet. I don't see anything different about the definition of that original document method snippet that makes it special. However, somehow it is special and the behavior can't be duplicated when making a new snippet. That is what was causing me problems. Is the software coded to recognize that specific snippet name? The response was helpful and at least I have it working now, but I'm not sure why it works that way.

Shawn

quote:
Originally posted by feline

What VA snippet are you editing?
What are you setting it to?
Can you post a sample function declaration that you are triggering Document Method on, and the comment that VA is then inserting for you?

Using VC6, VA 2217 under Windows 7, I have set the Snippet "Refactor Document Method" to the code:

/*
 * @method $SymbolName$
 * @FullMethod $SymbolContext$
 * @access $SymbolVirtual$$SymbolPrivileges$$SymbolStatic$
 * @return $SymbolType$
 * @qualifier $MethodQualifier$
 * @parameter $MethodArg$
 */


and then I triggered Document Method on the function:

static void simpleVc6DoxygenFormatTest(int nParamOne, int nParam2);


which produced the following comment block:

/*
 * @method simpleVc6DoxygenFormatTest
 * @FullMethod simpleVc6DoxygenFormatTest
 * @access public static 
 * @return void
 * @qualifier
 * @parameter int nParamOne
 * @parameter int nParam2
 */
static void simpleVc6DoxygenFormatTest(int nParamOne, int nParam2);


I have just guessed at the correct formatting and tag names for Doxygen comments, since as I recall there are at least 2 different supported formats, and many possible tags. However, as you can see, this is working perfectly well for me here. So I am wondering what I am doing differently to you.

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - May 11 2017 :  4:53:45 PM  Show Profile  Reply with Quote
The refactoring snippets are special snippets, that are used by the refactoring commands. These enable the snippets to access and insert scope specific information that would otherwise not be known.

So to update one of the refactoring snippets, you have to edit the actual refactoring snippet. Making a new snippet with a similar name will have no effect on the refactoring command.

Have you now updated the actual, pre-existing refactoring document method snippet?

zen is the art of being at one with the two'ness

Edited by - feline on May 11 2017 4:56:07 PM
Go to Top of Page

shawn1874
New Member

USA
6 Posts

Posted - May 11 2017 :  9:36:43 PM  Show Profile  Reply with Quote
Yes, and it works. It looks similar to other snippets so I did not know that I could only edit the pre-existing ones. Problem solved.

quote:
Originally posted by feline

The refactoring snippets are special snippets, that are used by the refactoring commands. These enable the snippets to access and insert scope specific information that would otherwise not be known.

So to update one of the refactoring snippets, you have to edit the actual refactoring snippet. Making a new snippet with a similar name will have no effect on the refactoring command.

Have you now updated the actual, pre-existing refactoring document method snippet?

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - May 12 2017 :  11:02:19 AM  Show Profile  Reply with Quote
Thank you for the update, I am glad this is now working correctly for you.

In newer IDE's we are using a more up to date Snippet editor dialog, that filters the build in Refactoring snippets into their own section, to try and make things clearer.

The refactoring snippets work the same as normal snippets, but since they are used by the refactoring commands, they have access to scope information that normal snippet commands cannot access.

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