wq-9

File-->Settings-->Editor-->File and Code Templates

复制代码
/**
 * @author     :mmzs
 * @date       :Created in ${DATE} ${TIME}
 * @description:${description}
 * @modified By:
 * @version:     $version$
 */
复制代码

此时,当你创建新的类时,就会自动生成注释了。

注意:一定要启用该模板才有效

如果还不行,就添加如下设置:

 

 

2、为方法添加自动注释模版

File-->Settings-->Editor-->Live Templates

点击"+"号后,选择"Templates Group…"

注意:此处一定要为刚刚的模板指定使用范围:

例如:我指定的是java

注释模板填写内容参考如下:

复制代码
/**
 * create by: mmzs
 * description: TODO
 * create time: $date$ $time$
 * 
 $params$
 * @return $return$
 */
复制代码

params的Exception内容如下:

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

 

 

12

分类:

技术点:

相关文章:

  • 2022-01-05
  • 2021-09-26
  • 2022-01-05
  • 2022-01-04
  • 2021-12-24
  • 2021-09-27
  • 2022-01-05
猜你喜欢
  • 2022-01-05
  • 2022-01-05
  • 2022-01-05
  • 2022-01-05
  • 2022-01-05
  • 2021-08-30
相关资源
相似解决方案