microsoft / microsoft/TypeScript

Rename symbol renamed element declaration in node_modules

Aperta
#63,450 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Needs More Info
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci l'azione Rename Symbol/F2 in un file .tsx usando il caso dell'elemento JSX segnalato, quindi esamina la dichiarazione interessata in node_modules/@types/react/index.d.ts. Verifica se la ridenominazione modifica la dichiarazione e causa l'errore JSX.IntrinsicElements segnalato; l'operazione è completata quando l'elemento locale viene rinominato senza modificare tale dichiarazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
react, typescript
Ambito
developer-experience, tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.