Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the automatic asterisk (inserting stars) in Eclipse when adding a multi-line comment?

Tags:

When adding a multi-line comment in Eclipse and format it(Ctrl+Shift+F), it automatically places an asterisk (*) at the beginning of each new line inside the comment block.

/*
 * this is my comment
 */

What is the reason of this behavior?

How can I disable it?

like image 697
Bobs Avatar asked Sep 02 '12 05:09

Bobs


People also ask

How do I hide comments in Eclipse?

Enabling 'Folding' in the preferences dialog lets you use the '+' and '-' buttons next to the line numbers to hide comments. Do do this... Then the comments will go away!


2 Answers

In Eclipse 4.2 and later, the solution is: Window -> Preferences -> Java -> Code Style -> Formatter ->

$profileName -> Edit... () -> comments ->* un-check [ ] Enable block comment formatting.

Note that the author asked for block comments (/*) and not for Javadoc comments (/**).

To supress leading * for Javadoc comments un-check [ ] Enable Javadoc comment formatting


(*) If $profileName -> Edit... doesn't work, create a new template using "New...".

See image highlighted in yello

like image 103
koppor Avatar answered Oct 14 '22 19:10

koppor


It's the standard javadoc format. Formatting options in eclipse are in right click your project->properties->Java Code Style->Formatter->Edit->Comments tab, but I don't see an option to disable this particular behavior.

like image 38
Thomas Avatar answered Oct 14 '22 18:10

Thomas