在
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模式下将重新格式化上述行,但只有当它们是/ * * / – 样式注释时.它会缩短//太长的行,但是它不会连接在一起太短的行.
您可能需要配置Java格式化程序以包含注释.
首选项 – > Java – >代码样式 – > Formatter – >编辑… – >注释
确保启用“启用XXX注释格式”.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。