如何防止Eclipse格式化程序弄乱文本符号注释? [英] How to prevent Eclipse formatter from messing up text-bulleted comments?

查看:72
本文介绍了如何防止Eclipse格式化程序弄乱文本符号注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有(Java)注释,例如:

I have (Java) comments such as:

/* 
 * 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 Eclipse auto-formatter sets the comment line width properly, but makes it:

/*
 * 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.
 */

如何使代码格式化程序将项目符号列表保持原样,同时仍以其他方式处理注释?

How do I the code formatter to leave the bulleted lists as-is, while still otherwise processing the comment?

注释:

  • 我不想关闭注释中的行合并,因为我确实希望我的注释行适合最大长度.因此,关闭行连接,关闭Javadoc注释的格式设置或暂时中止自动格式设置都是不可接受的解决方案.
  • 可能是相关的问题.

推荐答案

此答案表示您在右侧添加了连字符在/* 开头之后,即:

This answer says that you add a hypen right after the opening /*, i.e.:

/*- 
 * 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格式化程序弄乱文本符号注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆