0

I like how Eclipse IDE indents my source code but I would like to keep my comments intact. How do I make Eclipse not touch comments in Java source code?

I am using Eclipse Luna.

Ariel
  • 1,222
  • 2
  • 14
  • 25

3 Answers3

4

Window -> Preferences -> Java -> Code Style -> Formatter here you have to create a copy of the default rules and change then as you like. Have a look at the Comments tab.

enter image description here

Kai
  • 38,985
  • 14
  • 88
  • 103
1

In Eclipse, Goto Window->Preferences->Java->Formatter and click on Edit your active profile. In the Comments tab, you will have the options to achieve what you want with a preview. Hope this helps

(Note: You may want to duplicate the existing profile if you need to revert back)

0

You can define your custom formatting rules in eclipse. Go to Eclipse Preferences--> Java --> Code Style --> Formatter and add your rules.

Kai
  • 38,985
  • 14
  • 88
  • 103
santosh-patil
  • 1,540
  • 1
  • 15
  • 29