Vitalii
Vitalii

Reputation: 11071

Eclipse comments formatting style

In Eclipse when I comment several lines of code I add /* at the beginning of first line and */ at the end of last line. But after I save Eclipse makes auto formatting and all lines becomes to start from *

Example is below. 2nd, 3rd, 4th and 5th lines was automatically changed with starting *

enter image description here

My problem is that when I uncomment my code I need to remove all leading stars from all lines! 5 lines is not a big problem but if I have 50... Combination Shift + Ctrl + \ does not helps. It removes only /* and */ but leave ll leading stars

Upvotes: 2

Views: 98

Answers (1)

nmore
nmore

Reputation: 2573

I don't think there is a way to remove these stars in Eclipse. If you don't want these stars to appear, turn off formatting in save actions, but this will turn off all save action formatting.

Preferences -> Java -> Editor -> Save actions

Then it won't convert your comments on save.

If you need this formatting to be on, then unfortunately you will have to use line comments for your temporary comments. Select your block of code and ctrl+/ to toggle it.

Upvotes: 1

Related Questions