I'd like to configure the organize import in Eclipse with one caveat: I do NOT want Eclipse to CHANGE the imports related to star imports (like import javax.xml.parsers.*).
I would like Eclipse not to expand (replace the star import with each specific ones) if there is already a star import, but also not automatically add the star when there is not.
In fact, I would like the organize import to just organize the imports (ie reorder), not change them. Any idea ?
I like it when IDE do not mess with developer's will.
The Organize Imports command can only be executed as a whole (see source code) and the Sort Members command ignores import statements.
As workaround to reorder/sort the import statements alphabetical use the AnyEdit Tools plug-in:
For .*
import statements only, set the number of imports needed for .*
to 0 (see Eclipse help - Organize Imports Preferences):
For adding import statements manually or via content assist only, disable Organize Imports on save (see Eclipse help - Clean Up Preferences):
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