Use of Resharper of C/C++ to generate function headers

We have resharper ultimate and i have installed the latest 2017.3.2

I was hoping that resharper C++ would allow us to generate XML headers from functions, (like the /// does in a C# file) but find no option for this ??

we have a number of ide's we use, in this case vs2012. 

If resharper C++ cant do this, it seems a pretty important omission considering you always need to add function headers ?

Thanks

5 comments

Hello Greg,

R++ can do that, but the action is invoked in a different way - you to need to run the "Document" context action when the caret is placed on a function name.

R++ generates doxygen-style documentation comments out of the box. If you need XML comments, you'll need to change the 'doc' live template.

Thanks!

0

Hi

I don't see any options to do this

-> Can you advise how to see these options ?

 

 

0

It's in the Alt+Enter menu, as all other context actions are.

0

I don't get a hammer symbol

The first time I used Alt+enter it asked what I wanted to associate the keys to, the next it worked ONLY if the function had no comments above it

Do you have a help url for "If you need XML comments, you'll need to change the 'doc' live template." ?

and is their a sample for the general /// XML doco header ?

Thanks

0

The "Document" action is not available when there already is a comment before the function - this is intentional, since usually when you want to generate a comment for a function it does not have a comment before it yet.

You can consult https://www.jetbrains.com/help/resharper/Templates__Creating_and_Editing_Templates.html for general help about editing templates. This is done from the ReSharper | Tools | Templates Explorer tool window. For XML comments, you'll need to change the doc template to something like this:

/// <summary>$END$</summary>
/// <param name="$PNAME$">$PDESCRIPTION$</param>
/// <returns>$RETURN$</returns>

With $PNAME$ macro expanding to the "Documentation: function parameter name" macro. Please take a look at the default doc template to get a better hang at how it works.

0

Please sign in to leave a comment.