Bren
Bren

Reputation: 3706

How to get eclipse to keep comments on separate lines

If I have a comment like this:

/* line 1
 * line 2
 * line 3
 */

when I 'clean up' eclipse converts it to

/* 
 * line 1 line 2 line 3
 */

I'd really like it not to do so.

I looked over the preferences and stackoverflow but I don't see a solution to my problem.

Upvotes: 2

Views: 207

Answers (1)

tobias_k
tobias_k

Reputation: 82949

I could get rid of this "feature" like this:

  • Go to Preferences -> Java -> Code Style -> Formatter
  • Click "Edit...", go to the Comments tab and select "Never join lines"
  • Change the profile name, if it is a built-in, and click OK

Once you're at it, I'd also recommend to deactivate "Format line comments on first column" so that commented code is not formatted. If you prefer your comment to start on the /* line, you also have to deactivate "/* and */ on separate lines".

Upvotes: 2

Related Questions