Idea custom method annotation

Idea custom method annotation

I am using a set of custom method annotations. In order to prevent the annotations from being changed when ctrl+alt+L is used to format the code, remove the checkmark from the red box in the idea settings.
insert image description here

image-20230428145517220

image-20230428145612803

templateText

**
 * @apiNote TODO
 $param$
 $return$
 */

param

groovyScript("if(\"${_1}\".length() == 2) {return '';} else {def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList();for(i = 0; i < params.size(); i++) {if(i==0){result+='* @param ' + params[i] + ' TODO'}else{result+='\\n' + ' * @param ' + params[i] + ' TODO'}}; return result;}", methodParameters());

return

groovyScript("def returnType = \"${_1}\"; def result = '* @return ' + returnType; return result;", methodReturnType());

Guess you like

Origin blog.csdn.net/shgzzd/article/details/130426674