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

查看:150
本文介绍了如何在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.

但是,它违背了 Sun约定,用于Java注释格式,直到jdk1.3(更新:当前oracle链接)(如也在这里)...

但是,如 Amedee Van Gasse 的评论中的mays-in-eclipse / 1641933#comment56743173_1641933 :

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开始,前导星号是可选的






一个更简单的方法(如果您只需要对代码的某些注释执行此操作,而保持另一个使用标准样式)是多行注释出现时像这样:


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天全站免登陆