microsoft / microsoft/TypeScript

Rename symbol renamed element declaration in node_modules

Open
#63,450 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs More Info
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Rename Symbol/F2 action in a .tsx file using the reported JSX element case, then inspect the affected declaration in node_modules/@types/react/index.d.ts. Verify whether the rename changes the declaration and causes the reported JSX.IntrinsicElements error; done means the local element is renamed without modifying that declaration.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.