redhat-developer / redhat-developer/vscode-java
Organize imports enhancement
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 546
- Ø Merge
- 20 Std. 1 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Es sind keine Dateien oder Tests genannt. Beginne mit der Durchsicht der verknüpften Issues und Pull Requests und verfolge anschließend den bestehenden Organize imports-Ablauf und dessen Code Actions für einzelne Dateien; als erledigt gilt die Unterstützung von Code Actions auf Ordnerebene, ohne das bestehende Verhalten zum Hinzufügen, Entfernen und Sortieren zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, typescript, vscode
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100