php – 如何在Eclipse PDT中重新格式化多行注释?

前端之家收集整理的这篇文章主要介绍了php – 如何在Eclipse PDT中重新格式化多行注释?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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注释格式”.

原文链接:https://www.f2er.com/php/131878.html

猜你在找的PHP相关文章