microsoft / microsoft/TypeScript
Rename symbol renamed element declaration in node_modules
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.3k
- Merge moyen
- 2 j 4 h
- PR mergées (30 j)
- 132
Description
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
```ts
// code snippet from node_modules/@types/react/index.d.ts
span: React.DetailedHTMLProps, 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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Reproduisez l’action Rename Symbol/F2 dans un fichier .tsx en utilisant le cas d’élément JSX signalé, puis examinez la déclaration concernée dans node_modules/@types/react/index.d.ts. Vérifiez si le renommage modifie la déclaration et provoque l’erreur JSX.IntrinsicElements signalée ; c’est terminé lorsque l’élément local est renommé sans modifier cette déclaration.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- react, typescript
- Domaine
- developer-experience, tooling
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100