microsoft / microsoft/TypeScript
Suggestion: ability to find imports for module
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
Find references is a very useful feature, however sometimes I need to be able to find all imports of a given module:
- regardless of what they're exporting
- but the module does not have any exports
This is sometimes necessary when a module has side effects, and you want to see which files imported it.
This might also be useful for dynamic imports. In one project we have several dynamic imports (for code splitting) that never explicitly reference the module exports, so if I use find references on those module exports, I will not be shown the dynamic import. For example, here is a dynamic import:

When I activate find references on the exports of that module, I am not shown the import:

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
Das Issue nennt keine Quelldateien oder Tests. Beginne damit, Find References bei einem Modul mit Seiteneffekten und bei einem dynamic import zu reproduzieren, und verfolge anschließend das language-service-Verhalten, das Referenzen auflöst. Als abgeschlossen gilt die Arbeit, wenn imports auffindbar sind, selbst wenn keine exports referenziert werden, einschließlich dynamic imports.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100