I found that when I save a .java file in Eclipse, it helps me to reformat any indentation and line breaks. This is very annoying. How can I avoid it?
|
This is part of "Code Clean up". You can configure what it does in Source -> "Clean Up ..." Apart from that, you can also configure the formatter if you want the code formatted in general but don't like the defaults. To change these settings, use Window -> Preferences -> Java -> Code Style -> Formatter. On the last tab of the formatter, you can define on/off tags which allow to you to prevent reformatting of some code. |
|||||||||||
|
|
You should be able to turn off formatting by placing a special comment, like
This can be changed in the preferences |
||||
|
|
|
You could disable you Go to |
|||
|
|
|
I think I found the answer for my own question.
This will disable all the source code format. There are some answers saying that
Both both are only the setting that tell how the code be formatted It will still format the source code even if you uncheck the Formatter and Clean UP but check the Editor *Save action* Java Editor will override all the source code settings. |
|||
|
|
