idea添加类注释和方法注释

一、idea添加类注释

Settings->File and Code Templates->Files

分别在Class 和 Interface添加

/**
*@description: TODO
*@author: mufeng
*@create: ${DATE} ${TIME}
*/

二、idea添加方法注释

Settings->Live Templates

1.添加Template Group 命名“methoddesc”(自定义)

2.添加Live Template 命名“**”(这样为了可以用/**+Tab),添加模板:


**
* @description: TODO
$param$
* @return: $return$
* @author: mufeng
* @time: $date$ $time$
*/

3.parm的Expression为groovyScript脚本,可以实时返回参数名称:

groovyScript("_1.collect { '* @param ' +it}.join('\\n ') + ''", methodParameters())



猜你喜欢

转载自www.cnblogs.com/mufeng07/p/12108656.html