修改IntelliJ javadoc模板
有没有办法修改 IntelliJ 用于方法 Javadoc 的模板?
特别是,我希望我的 javadoc 注释看起来像这样:
/******************** * * Comment here * *********************/
但是,当我重新格式化代码时,javadoc 最终看起来像这样:
/** * ****************** * * Comment here * ******************** */
Is there a way to modify the template IntelliJ uses for a method's Javadoc?
In particular, I want my javadoc comments to look like this:
/******************** * * Comment here * *********************/
However, when I reformat the code, the javadoc ends up looking like this:
/** * ****************** * * Comment here * ******************** */
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那么您似乎并不需要 JavaDoc 注释,因为它们的定义看起来像 IntelliJ 的制作方式。
您可以禁用 JavaDoc 格式:
启用 JavaDoc 格式
这样,您就可以将多行注释重新格式化为 JavaDoc 注释。
IntelliJ 将它们(正确地)识别为 JavaDoc 注释,因为它们有两个星号。
您还可以通过在第二个星号之前添加空格将它们更改为常规多行注释(不是 JavaDoc 注释)(例如
/* ****************
),这也应该让 IntelliJ 不重新格式化它们。It doesn't seem like you want JavaDoc comments then, as they are defined to look like how IntelliJ is making them.
You can disable JavaDoc formatting:
Enable JavaDoc formatting
This way, you can have your multi-line comments not get reformatted as JavaDoc comments.
IntelliJ is identifying them (correctly) as JavaDoc comments since they have two asterisks.
You can also change them to regular multi-line comments (not JavaDoc comments) by adding a space before the second asterisk (e.g.
/* ****************
), which should also have IntelliJ not reformat them.