Auto fill within live templates

Answered

Hey folks,

Our code guidelines require we demarcate sections of code with comments such as:

// ----- public methods ------------------------------------------  (out to 78 chars max)

Is there a way to create a live template that would allow me to insert the name, but always fill the dashes to 78 no matter what name I insert?

 

Thanks,

-rl

 

0
1 comment

Should be possible with the use of the groovyScript function for the variable: https://www.jetbrains.com/help/idea/template-variables.html .

You could write a script that will pad the text with the dashes to the desired length.

0

Please sign in to leave a comment.