microsoft / microsoft/TypeScript

Rename symbol renamed element declaration in node_modules

Abierto
#63,450 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Needs More Info
Lenguaje dominante
Go
Estrellas
111k
Forks
14.3k
Merge medio
2 d 4 h
PR fusionados (30 d)
132

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce la acción Rename Symbol/F2 en un archivo .tsx usando el caso de elemento JSX reportado y, a continuación, inspecciona la declaración afectada en node_modules/@types/react/index.d.ts. Verifica si el renombrado cambia la declaración y provoca el error JSX.IntrinsicElements reportado; se considera completado cuando el elemento local se renombra sin modificar esa declaración.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
react, typescript
Área
developer-experience, tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.