【发布时间】:2012-09-16 16:50:38
【问题描述】:
我有 (Java) cmets,例如:
/*
* The quick brown fox jumped over the lazy dog.
*
*
* Notes:
* - The quick brown fox jumped over the lazy dog. The quick brown fox
* jumped over the lazy dog. The quick brown fox jumped over the lazy
* dog.
* - The second quick brown fox jumped over the lazy dog. The quick brown
* jumped over the lazy dog. The quick brown fox jumped over the lazy
* dog.
*/
Eclipse 自动格式化程序会正确设置注释行宽,但会这样做:
/*
* The quick brown fox jumped over the lazy dog.
*
*
* Notes: - The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy
* dog. The quick brown fox jumped over the lazy dog. - The second quick brown fox jumped over the
* lazy dog. The quick brown jumped over the lazy dog. The quick brown fox jumped over the lazy dog.
*/
代码格式化程序如何让项目符号列表保持原样,同时仍处理注释?
注意事项:
- 我不想关闭 cmets 中的行连接,因为我确实希望我的注释行适合最大长度。因此,关闭线路连接、关闭 Javadoc cmets 的格式化、或暂时暂停自动格式化,都是不可接受的解决方案。
- Possibly related question。
【问题讨论】:
-
我在 Eclipse 中遇到了与 Scala 相同的问题,但以下解决方案是特定于 Java 的,因为 Scala 代码格式化程序选项卡有不同的选项。有没有办法关闭 Scala 的注释重新格式化?
-
@GlennStrycker:好吧,既然没有人给我一个可以接受的答案,我们现在几乎在同一条船上:-(
标签: eclipse formatting comments