microsoft / microsoft/TypeScript

Rename symbol renamed element declaration in node_modules

Offen
#63,450 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Needs More Info
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: Insider (don't remember the precise version, explained below)
  • OS Version: 10.0.19044 Build 19044 (Microsoft Windows 10 IoT Enterprise LTSC)
Steps to Reproduce:
  1. use "Rename Symbol" [F2 default keybind] to rename a jsx/tsx element in a .tsx file (in my case it was p -> span)
Expected outcome:

element to be renamed to the entered one (span)

Actual outcome:
  1. Renamed the element's declaration in node_modules/@types/react/index.d.ts for the entire project.
  2. renamed the element in the file i was working in to span (effectively still remaining a paragraph element)
  3. code editor throwing error Property 'p' does not exist on type 'JSX.IntrinsicElements'. anywhere where element p is used
// code snippet from node_modules/@types/react/index.d.ts
span: React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
Additional information:

This happened around a month ago, therefore I cannot recall the version I was on.
I had attempted reinstalling packages, code editors (both insider and default one), package managers (npm, bun, yarn, pnpm), with and without tsgo.
Could not fix the error during this whole time, so I worked on the project on a different machine which didn't have the issue.

Let me know if there if you need any additional information

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere die Aktion Rename Symbol/F2 in einer .tsx-Datei mit dem gemeldeten JSX-Element-Fall und untersuche anschließend die betroffene Deklaration in node_modules/@types/react/index.d.ts. Überprüfe, ob die Umbenennung die Deklaration ändert und den gemeldeten JSX.IntrinsicElements-Fehler verursacht; abgeschlossen ist die Aufgabe, wenn das lokale Element umbenannt wird, ohne diese Deklaration zu ändern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react, typescript
Bereich
developer-experience, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.