问题描述
在 Eclipse 中,我可以通过选择注释并按 Shift + Ctrl + F
来格式化注释.例如,当我选择这样的方法注释时:
In Eclipse, I can format comments by selecting them and pressing Shift + Ctrl + F
. For example, when I select a method comment like this:
/**
* This method
* does some stuff.
*/
并按下Shift + Ctrl + F
,Eclipse会自动包装它:
and press Shift + Ctrl + F
, Eclipse automatically wraps it:
/**
* This method does some stuff.
*/
IDEA 中是否有类似的东西?
Is there anything comparable to this in IDEA?
编辑:澄清一下,我正在寻找注释格式,该格式也可以将太长的行分成多行.
EDIT: To clarify, I'm looking for comment formatting that also breaks lines that are too long into multiple lines.
推荐答案
你能得到的最接近的是Edit
|加入行
(++).您必须先选择要加入的行.
The closest thing that you can get is Edit
| Join Lines
(++). You have to select the lines you want to join first.
要包装长评论启用设置
|代码风格
|JavaDoc
|在右边距换行
.
To wrap long comments enable Settings
| Code Style
| JavaDoc
| Wrap at right margin
.
这篇关于IntelliJ IDEA 中类似 Eclipse 的注释格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!