Open
Description
Currently "Organize imports" will do three things:
- Add missing imports
- Remove all unused imports
- Sort existing imports
And there are serveral requests about feature "Organize imports":
Organize import without sorting:
Organize imports (and other code actions) in multiple files:
- Organize Imports action on multiple files #1107
- Organize import at package/folder level #2282
- Support organize imports for multiple files microsoft/vscode-java-pack#1085
We can find rooms to improve. Although we have configuration java.completion.importOrder
, it's not such visible and it's hard to "hardcode" a package list for some users. In this way, we can have serveral points to improve:
- Add "Remove all unused imports" quickfix for related warnings Support "remove all unused imports" eclipse-jdtls/eclipse.jdt.ls#2280
- it just remove all unused imports, will not affect existing valid imports
- Add "Add all missing imports" quickfix for related errors Support "Add all missing imports" eclipse-jdtls/eclipse.jdt.ls#2292
- it just add all missing imports, will not affect(sort) existing valid imports
- Support "Add all missing import" when pasting Add missing import on paste #2795
- Support code actions (and formatting maybe) in folder level