microsoft / microsoft/TypeScript
Rename file when renaming default export
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
Currently we can use the rename symbol command and that will rename the symbol and its usages (exports, imports, usages in other files, etc.). That's a great start, but I'd love to see this feature expanded to do the following:
-
Many times a file name will coincide with the symbol being refactored. The refactor option should be available when renaming the file, so everything can be done at once.
-
In addition to the refactor changing symbol references across all files, it'd be nice to have the ability to also update comments, strings, etc. that refer to that symbol.
Code Example:
Shape.js
class Shape {}
export default Shape;
Circle.js - We reference Shape as an import, extends, inside a comment, and inside a string. They should all be refactored.
import Shape from "./Shape";
// Shape subclass
class Circle extends Shape {
constructor() {
super();
console.log('A circle is a Shape.');
}
}
export default Circle;
WebStorm Examples
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 mit dem vorhandenen Befehl rename symbol und verfolge, wie er Exporte, Importe und Verwendungen dateiübergreifend aktualisiert. Verwende das Beispiel mit Shape.js und Circle.js als Abnahmefall: Das Umbenennen des Default-Exports sollte außerdem die passende Datei umbenennen und die gezeigten Import-, Kommentar- und String-Referenzen aktualisieren.
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
- 25/100