Support "remove all unused imports"#2280
Conversation
Signed-off-by: Shi Chen <[email protected]>
Signed-off-by: Shi Chen <[email protected]>
Signed-off-by: Shi Chen <[email protected]>
|
I'll merge this as the problem is a bit of a corner case, but there is a bug that I noticed. It seems to be an upstream issue with diagnostics though. Basically "Organize Imports" does the right thing, but "Remove all unused imports" only removes the imports that have an "unused" diagnostic (unused, unresolved, duplicate, etc.). In other words it's based on the diagnostics emitted rather than whether it truly is unused. However, when you create some import that can't be resolved, other diagnostics don't seem to be emitted, causing the issue. |
|
@rgrunber Yeah, I can also reproduce it via eclipse "Clean Up". it seems that if there are error markers about "import can not be resolved" related to import statements, the unused markers will be skipped to generate. |

Signed-off-by: Shi Chen [email protected]
See: redhat-developer/vscode-java#2748
removeall.mp4