microsoft / microsoft/TypeScript
Feature Request: Update wrong defined import statements?
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
I wonder if there is a feature in vscode to automatically delete imports that are incorrectly defined? Like this:

There is no function named "getData" from "response.ts". Because that function is moved somewhere else within the project. I ask this because incorrectly defined import statements are not deleted automatically by "removeUnusedImports". Because they are used in the file.
In fact, if it could be deleted, then the "addMissingImports" command could do its job and add these imports to the file, so that we could see that the function that was moved in the project was imported from the right place.
PLUS, it would be great if this feature could work when functions are relocated, just like vscode detects when files are relocated and updates the imports. But I am not sure about feasibility of this.
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
Beginne damit zu untersuchen, wie die vorhandenen Befehle removeUnusedImports und addMissingImports Importe behandeln, deren exportierte Funktion verschoben wurde. Definiere das erwartete Verhalten für falsch definierte Importe und verschobene Funktionen, und überprüfe anschließend, dass das vorgeschlagene Feature die korrekte neue Quelle identifizieren kann, ohne gültige Importe zu löschen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100