在Eclipse PDT
,Ctrl-Shift-F
重新格式化代码。但是,它根本不会修改注释。有没有办法将不规则的多行注释重新格式化为每行80个字符(或其他)?如何在Eclipse PDT中重新格式化多行注释?
即转换
// We took a breezy excursion and
// gathered Jonquils from the river slopes. Sweet Marjoram grew
// in luxuriant
// profusion by the window that overlooked the Aztec city.
到
// We took a breezy excursion and gathered Jonquils
// from the river slopes. Sweet Marjoram grew in
// luxuriant profusion by the window that overlooked
// the Aztec city.
(我认为这也适用于普通的Eclipse为好。)
更新原来,Eclipse
在Java
模式将重新设置上面的行,但只有他们是/ * */- 风格的评论。它会缩短太长的线条,但不会连接太短的线条。
这些实际上是单行注释。多行注释始终使用/ * - 表示法。 – 2010-05-19 07:40:02
我认为他的意思是跨越多条单行评论。这种事情是除Python中的文档串以外进行任何评论的典型方式。 – javawizard 2012-12-11 00:16:38