A lot of my co-workers enjoy leaving behind commented out code, how to make Eclipse Formatter to not destroy formatting of that code(now it makes a big blob or block of it).
P.S. I know I can somehow configure the formatter to just ignore that code, I done it once, but I cant remember how.
In the Eclipse Formatter Settings (Preferences/Java/Code Style/Formatter) in the tab Comments UNCHECK the checkbox "Enable Block Comment Formatting" and "Enable Line Comment Formatting" These should be disabled anyway.
One option in 3.6 would be to tell Eclipse not to format these blocks, using /* @formatter:off */
Another option that I use a lot when working in other people's code is to select the lines I'm working on before invoking the formatter - that way I only format the areas I've actually changed, and leave the rest untouched (to get more readable diffs etc.).
For Eclipse 3.7.1, there's a new configuration page (Off/On Tags) in the code format profiles. Make sure you've enabled them. You can also specify the exact comment off and comment on tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With