Live Template Variables - methodParameters() expansion problem
Hi
I have created a new live template with variables as per
http://www.jetbrains.com/idea/webhelp/edit-template-variables-dialog.html
When I use a live template as follows
Preconditions.checkNotNullArgument($parameter$, "$parameter$");
where $parameter$ is defined as methodParameters()
When used within a method, it expands as follows
public final SERVERTHEN replyWith(Object response) {
Preconditions.checkNotNullArgument([response], "[response]");
...
}
}
Is there a reason why the square brackets are included in the expansion? In each case I need to remove them from the parameter name to get the statement to compile?
I am running 12.1.1 Ultimate edition.
Thank you.
请先登录再写评论。
Hello.
Looks like that's done intentionally: since we can't predict what exactly user want to do with many parameters, he has to write some custom processor.
Take a look at bundled *soutp* template: it uses methodParameters(), maybe that idea is good for you.
Regards,
Alexander.