Live Template "doc": Add new line when using $PNAME$ macro

I'm trying to extend the "doc" Live Template so that it will list all parameters and its description in a own line such as:

// Funcname
// Brief description
//
// first_parameter:
// Description of first parameter
//
// second_parameter:
// Description of second parameter
void Funcname(int first_parameter, int second_parameter);

But I don't really know how I can tell resharper to insert a new line on the same line where $PNAME$ is defined, because $PNAME$ will duplicate it's own line for each parameter the function has.

This is my template:

// $FNAME$:
// $brief$
//
// $TNAME$: $LINEBREAK$// $TDESCRIPTION$ $LINEBREAK$//
// $PNAME$: $LINEBREAK$// $PDESCRIPTION$ $LINEBREAK$//
// $MNAME$: $LINEBREAK$// $MDESCRIPTION$ $LINEBREAK$//

While "$LINEBREAK$" is a macro to the constant value \n
I also tried it with the constant value "\n" or '\n' but this didn't work either.

When using plain \n as constant value for $LINEBREAK$ it actually inserts a new line but also combined with a trailing \

This is the result I get when using the live template:
// ### Funcname:
// brief
//
// first_parameter (in/out): \
// PDESCRIPTION0 \
//
// second_parameter (in/out): \
// PDESCRIPTION2 \
void Funcname(int first_parameter, int second_parameter);

 

Is there something I'm missing?
How can I insert a new line without this trailing "\"?

1 comment
Comment actions Permalink

Hello,

I don't think this is possible at the moment. I guess we can add a new documentation macro that inserts a line break - https://youtrack.jetbrains.com/issue/RSCPP-32030.

1

Please sign in to leave a comment.