✨IDEA 方法注释配置

117 字
1 分钟
✨IDEA 方法注释配置

IDEA 方法注释配置#

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

4.png
4.png

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

参数模板配置

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()

颜色模板注释

/**
* <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/
作者
北港不夏
发布于
2025-07-09
许可协议
CC BY-NC-SA 4.0

评论区

Profile Image of the Author
北港不夏
Hello, I'm 北港不夏.
公告
欢迎来到我的博客!这是一则示例公告。
音乐
封面

音乐

暂未播放

0:00 0:00
暂无歌词
分类
标签
站点统计
文章
36
分类
3
标签
49
总字数
22,285
运行时长
0
最后活动
0 天前

文章目录