mac idea 配置类和方法的注释
1.配置类的注释
1.1 修改位置
方法一:快捷键打开
command+,
方法二:路径打开
Preference->Editor->File and Code Templates->Files
打开之如下图所示:

1.2 修改 class 或者 interface 注释格式
复制代码
1.3 验证
新建类进行验证:

2.配置方法的注释
2.1 修改位置
方法一:快捷键打开
command+,
方法二:路径打开
Preference->Editor->Live Templates

2.2 修改方法的注释
2.2.1 添加 Template Group

2.2.2 在自定义的 Template Group 下添加 Live Template

2.2.3 Live Template 的参考值和设置
1)Abbreviation:*
2)expand with:选择 Enter

2.2.4 Template Text 格式
复制代码
2.2.5 Edit variables 参数表达式

1)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\b' : '')}; return result", methodParameters())
2)return:methodReturnType()
3)description: description()
4)date: date()
5)time: time()
2.2.6 验证

评论