我如何在Eclipse多行注释关闭'*'? [英] How do I turn off '*' in multi-line comments in Eclipse?

查看:338
本文介绍了我如何在Eclipse多行注释关闭'*'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在与Eclipse的编码,你怎么当你开始多行注释关闭*评论说,上来?

When coding with Eclipse, how do you turn off the "*" comments that come up when you start a multi-line comment?

而不是看到这一点,

/**
* Here is a comment
* some more 
*/

我能得到这个?

/**
  Here is a comment
  some more
*/

如果你想知道的/ **,是因为我使用doxygen的。

If you are wondering the "/**" is because I use doxygen.

推荐答案

作为的这个线程,你只能做到这一点(意为转到

As mentioned in this thread, you can only do that (meaning "disabling the leading asterisks") by going to

 Preferences > Java > Code Style > Code Templates

因此​​,例如,如果您修改模板字段的意见为:

So for example, if you modify the template for comments of a field into:

/**

 */

这会这样(中间无任何星号)时,你会评论的字段。

It will come that way (without any asterisk in the middle) when you will comment a Field.

然而,它确实违背<一个href=\"https://web.archive.org/web/20091004164147/http://java.sun.com/j2se/javadoc/writingdoccomments/index.html\"相对=nofollow> 太阳约定用于Java注释格式高达JDK1.3(更新:的当前Oracle链接)(如图<一个href=\"https://web.archive.org/web/20120626135530/http://java.sun.com/docs/$c$cconv/html/$c$cConventions.doc4.html#16838\"相对=nofollow>也在这里)...结果
然而,如注意到<一href=\"http://stackoverflow.com/questions/1641748/how-do-i-turn-off-in-multi-line-comments-in-eclipse/1641933#comment56743173_1641933\">in由的评论href=\"http://stackoverflow.com/users/766786/amedee-van-gasse\">阿梅代范Gasse

However, it does go against the Sun convention for Java comment formatting up to jdk1.3 (update: current oracle link) (as seen also here)...
However, as noted in the comments by Amedee Van Gasse:

用的Javadoc 1.4,领先的星号开始可选

Starting with Javadoc 1.4, the leading asterisks are optional.

这是更简单的方法(如果你只需要做到这一点对你的codeS的一些意见,同时保持另一​​个与标准样式),当一个多行注释出现像这样的:


An even simpler way (if you only need to do that for certain comments of your codes, while keeping the other one with the standard style) is, when a multi-line comment appear like this one:

/**
 *
 */

,你可以先删除一个领先的星号,则输入您的意见。结果
你会看到没有其他领先的星号表示在注释每个新行的开始了。

, you can first remove the one leading asterisk, the enter your comments.
You will see no other leading asterisks are showing up at the beginning of each new line of comments.

 /**

  */

 /**
    My first line of comment
    My second line of comment
    My third line of comment
  */

这篇关于我如何在Eclipse多行注释关闭'*'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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