tags:

views:

61

answers:

1

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

Instead of seeing this,

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

Can I get this?

/**
  Here is a comment
  some more
*/

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

+1  A: 

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.

However, it does go against the Sun convention for Java comment formatting (as seen also here)...


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
  */
VonC
Thanks for your reply.I tried that and unfortunately, it doesn't work. But, on a related note, the file I'm editing is a .c file. For everyone's information, even without the above hint, if I try to edit a java file, it does NOT give me the leading asterisk.But, I need the feature for a C file !!!
chronodekar
I've been hunting for a while now. Since I can't seem to find anything better, I'm going with your second method. (I'll mark this as answered)
chronodekar