我有 (Java) 注释,例如:
/*
* 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.
*/
代码格式化程序如何让项目符号列表保持原样,同时仍处理注释?
注意事项:
- 我不想关闭加入评论的行,因为我确实希望我的评论行适合最大长度。因此,关闭行连接、关闭 Javadoc 注释的格式设置或暂时暂停自动格式化,都是 Not Acceptable 解决方案。
- Possibly related question .
最佳答案
This answer表示您在开头 /*
之后添加了一个连字符,即:
/*-
* 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 - 如何防止 Eclipse 格式化程序弄乱带有文本符号的注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12578398/