110 字
1 分钟

✨IDEA 方法注释配置

2024-10-05
浏览量 加载中...

IDEA 方法注释配置

创建方法注释模板: File→Settings→Editor→Live Templates

4.png

text
**
 * $Description$
 *
$param$
 * @return $return$
 * @author xxx
 * @date $date$ $time$
 */

参数模板配置

text
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) ? '\\\\r\\\\n' : '')}; return result", methodParameters())

return: groovyScript("def result=\\"${_1}\\"; if(result == \\"void\\"){return \\"\\";}else{return \\"{@link \\"+result+\\"}\\";}", methodReturnType())

date: date()

time: time()

颜色模板注释

java
/**
 * <strong style='color:purple;'>Created with IntelliJ IDEA.<hr>
 * <strong style='color:orange;'>Author: <hr>
 * <strong style='color:yellow;'>Date: ${DATE} ${TIME}<hr>
 * <strong style='color:blue;'>Class: ${PACKAGE_NAME}<hr>
 * <strong style='color:green;'>Project: ${PROJECT_NAME}<hr>
 * <strong style='color:red;'>Description: ${Description}<hr>
 */

支持与分享

如果这篇文章对你有帮助,欢迎分享给更多人或赞助支持!

赞助
✨IDEA 方法注释配置
https://dear7575.cn/posts/idea-setting
作者
北港不夏
发布于
2024-10-05
许可协议
CC BY-NC-SA 4.0
最后更新于 2024-10-05,距今已过 548 天

部分内容可能已过时

评论区

目录