Eclipse Javadoc注释中的换行错误 [英] Bad line breaking in Eclipse javadoc comments

查看:72
本文介绍了Eclipse Javadoc注释中的换行错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为,Eclipse内置Java格式化程序中有一个小而烦人的错误.我有一个Javadoc注释,看起来像这样:

There's a minor but annoying bug, I think, in the Eclipse built-in Java formatter. I have a Javadoc comment that looks like this:

/**
 * - - - stuff - - - {@code mTasksBelow}.
 */

其中结尾的句点在第81列中.格式化程序设置为在第80行包装Javadoc注释.不幸的是,当我格式化代码时,它是这样做的:

where period at the end is in column 81. The formatter is set to wrap Javadoc comments at line 80. Unfortunately, when I format the code, it does this:

/**
 * - - - stuff - - - {@code mTasksBelow}
 * .
 */

这会在生成的输出中的文本和句点之间放置空格,因此,例如,以HTML呈现Javadoc的浏览器也认为可以在此处中断.

This puts white space between the text and the period in the generated output, so a browser rendering the Javadoc in HTML, for instance, will also think it's okay to break there.

除非在Javadoc标记后加上句点,否则似乎不会发生这种情况. (例如,如果该行在第81列中以右圆括号和句点结尾,那么它将在最后一个单词之前正确地断开.)

This doesn't seem to happen unless the period follows a Javadoc tag. (For instance, if the line ended with a closing parenthesis and a period in column 81, it would correctly break before the last word.)

我可以移动换行列,但这只会解决问题.我不想转身 离线中断,因为我希望Javadoc源代码与生成的输出一样可读.我缺少某些设置吗,或者这实际上是一个错误吗?

I could move the wrap column, but that would just move the problem. I don't want to turn off line breaks, because I like my Javadoc source to be as readable as the generated output. Is there some setting I'm missing or is this actually a bug?

推荐答案

现在,它是一个新的 Eclipse错误.显然,它仍将存在于最初的Indigo版本中.

Well, it is now a new Eclipse bug. It will evidently still be present in the initial Indigo release.

这篇关于Eclipse Javadoc注释中的换行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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