在Eclipse PDT
,Ctrl-Shift-F
重新格式化代码.但是,它根本不会修改注释.有没有办法将不规则的多行注释重新格式化为每行80个字符(或其他)?
即转换
// 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
模式下将重新格式化上面的行,但前提是它们是/**/ - 样式的注释.它会缩短//太长的行,但它不会连接太短的行.