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.
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.
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)
You can define your custom formatting rules in eclipse. Go to Eclipse Preferences--> Java --> Code Style --> Formatter
and add your rules.