redhat-developer / redhat-developer/vscode-java
Organize imports enhancement
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
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:
- https://github.com/redhat-developer/vscode-java/issues/1575#issue-677597353
- https://github.com/redhat-developer/vscode-java/issues/1575#issuecomment-879667855
Organize imports (and other code actions) in multiple files:
- https://github.com/redhat-developer/vscode-java/issues/1107
- https://github.com/redhat-developer/vscode-java/issues/2282
- https://github.com/microsoft/vscode-java-pack/issues/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 https://github.com/eclipse/eclipse.jdt.ls/pull/2280
- it just remove all unused imports, will not affect existing valid imports
- Add "Add all missing imports" quickfix for related errors https://github.com/eclipse/eclipse.jdt.ls/pull/2292
- it just add all missing imports, will not affect(sort) existing valid imports
- Support "Add all missing import" when pasting https://github.com/redhat-developer/vscode-java/pull/2795
- related API: https://github.com/microsoft/vscode/issues/30066
- Support code actions (and formatting maybe) in folder level
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by reviewing the linked issues and pull requests, then trace the existing Organize imports flow and its single-file code actions; done means supporting code actions at folder level without regressing the existing add, remove, and sort behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100