使用groovy脚本生成idea方法注释参数格式对齐

模板:
/**
 * @Author zhangdaquan
 * @Desc TODO
 * @Date $date$
 $params$
 $return$
 */

params的expression:

groovyScript("def resu< =''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i  params.size(); i++) {resu< +=' * @param ' + params[i] + ((i  params.size() - 1) ? '\\n' : '')}; return resu< .substring(1,resu< .len >h())", methodParameters()) 

return的expression:

groovyScript("def params=\"${_1}\"; if(params=='void'){return '';} else {return '* @return ' + params}", methodReturnType()) 

 

最新回复(0)
/jishuxNCdX1XJSgwSe36PppkWZtQojRyxz7T0Gdj1pA_3D_3D4794580
8 简首页