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

ps: 这个脚本比较完善,会有个if else判断,能确保@param的位置保持整齐

 

最开始我设置的是自定义的快捷键 mj(就是mj + table键 出来模板),不是 *,结果获取到参数总是为null

IDEA自定义方法模板,脚本获取方法参数为null

 

 

最后将快捷键设置成*,终于正常了

IDEA自定义方法模板,脚本获取方法参数为null

 

对应的 Edit variables设置

IDEA自定义方法模板,脚本获取方法参数为null

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2021-12-07
  • 2022-12-23
猜你喜欢
  • 2021-09-27
  • 2022-01-20
  • 2021-09-14
  • 2021-05-08
  • 2021-08-29
相关资源
相似解决方案