文件头
- 设置路劲:settings -> file and code templates -> files -> Class
- 设置:
1 | #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end |
方法
输入/** 回车自动注释,根据设置返回值与参数值,参数为空时不设置参数,注释完光标在第二行直接输入注释信息
设置路劲:settings -> Live templates -> add group -> add live Templates
- templete text:
1
2
3
4**
* $END$
* $PARAM$@return $RETURN$
**/```- PARAM:
1
groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {if(params[i] == '') continue; result+='@param ' + params[i] + ' ' + params[i] + '\\n * '}; return result", methodParameters())
- RETURN:
1
methodRetrunType()