一、进入live template模板

快捷键:Ctrl+Shift+A进入Find Action,输入live template

IntelliJ IDEA生成live template(代码模板)

回车进入模板设置

二、添加模板组

IntelliJ IDEA生成live template(代码模板)

输入组名点击确认

三、添加模板

IntelliJ IDEA生成live template(代码模板)

四、编辑模板

IntelliJ IDEA生成live template(代码模板)

五、指定变量函数

IntelliJ IDEA生成live template(代码模板)

将以下代码赋值粘贴到上面param对应处

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 ' : '')};return result", methodParameters()) 

另外附上我的代码模板

*
 * @Author 
 * @Date $time$ $date$
 * @Description 
 
 $param$ 
 
 * @Return $return$ 
 * @Exception $exception$
 */

六、快捷键生成模板

在方法体上面输入/**,然后按tab键就可以生成如下注释

IntelliJ IDEA生成live template(代码模板)

相关文章:

  • 2021-09-03
  • 2021-10-03
  • 2022-12-23
  • 2021-08-06
  • 2022-01-01
  • 2021-04-06
  • 2022-02-06
  • 2022-12-23
猜你喜欢
  • 2021-09-15
  • 2021-05-17
  • 2021-07-09
  • 2021-11-03
  • 2021-10-29
  • 2021-12-04
  • 2021-04-01
相关资源
相似解决方案