How to enable automatic formatting and cleanup
By default automatic formatting and cleanup is disabled. To enable it, do the following:
- Go to Window > Preferences > Java > Editor > Save Actions.
- Select Perform the selected actions on save.
- Select Format Source code. Make sure Format all lines is selected. Below I discuss when to use the other option.
- Make sure Organize imports is selected.
- Select Additional actions.
- Click Ok, edit some code, save it and watch Eclipse format it automatically.
Here’s what the settings should look like.
Read full article from Automatically format and cleanup code every time you save | Eclipse On E
No comments:
Post a Comment