Community
Participate
Working Groups
I usually do an source "Format" before a file save. The only reason I do not do it all the time is that it is a pain to right-click and go through the menus.
Same comment with Organize Imports.
*** Bug 26275 has been marked as a duplicate of this bug. ***
If doing both format and organise imports, then IMHO they should be done in this order: o Organise Imports o Format o Save Organise imports can insert extra lines in the package list, and the code format has an option to remove blank lines, so in order for the latter option to be preserved it should be done after the imports are organised.
You could add Sort to the list of options BUT Sort breaks code sometimes IF variable initialization depend on each other and Sort reorders them.
Comment #4 is valid, but should not necessarily associated with this bug. The sort ordering may be being addressed to be more intelligent to avoid this problem in the future. Combinations of organise imports/format/sort/save should probably be options which can be enabled/disabled to avoid some of these problems.
*** Bug 49080 has been marked as a duplicate of this bug. ***
dup of bug 6749
I like this one better because it contains exactly one request. The other one contains various requests in one PR.
Now we have a nice formatter very useful with plenty of options and that now handle wery well "Imports" so it will not interfer with "Organize imports" I still think this kind of automation could be nice to have Indeed, it will become a useful trick for a lot of other automation (Organize imports on save, Organize imports on format, organize imports on save, etc...) I could moreother be done with AspectJ Is this to be handled for 3.0 or may be 3.1 ?
*** Bug 70045 has been marked as a duplicate of this bug. ***
See also http://www.instantiations.com/codepro/ws/docs/preferences/preferences_editors.h tml
There might be a general hook for loading and saving files. This can be used with team policies to format a file on open to the developer's preferences and format it on save to the team's preferences (allowing an easy diff and merge).
Gunnar Wagenknecht wrote: > There might be a general hook for loading and saving files. This can be used > with team policies to format a file on open to the developer's preferences and > format it on save to the team's preferences (allowing an easy diff and merge). Wow, that feature would be a very cool one!
With the only drawback that it would probably confuse the quick diff feature.
*** Bug 80757 has been marked as a duplicate of this bug. ***
What is happening with this one? Are there any plans to implement it?
>What is happening with this one? Are there any plans to implement it? Not for 3.2.
While we wait for this to be integrated into Eclipse, I made a simple plugin that automatically formats and organizes imports when saving a Java editor. It is compatible with Eclipse 3.1 and 3.2M1 and can be downloaded at http://sourceforge.net/project/showfiles.php?group_id=47272&package_id=164404
*** Bug 28804 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of 6749 ***