microsoft / microsoft/TypeScript

Rename symbol renamed element declaration in node_modules

Đang mở
#63,450 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Needs More Info
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện thao tác Rename Symbol/F2 trong một tệp .tsx bằng trường hợp phần tử JSX được báo cáo, sau đó kiểm tra khai báo bị ảnh hưởng trong node_modules/@types/react/index.d.ts. Xác minh liệu việc đổi tên có thay đổi khai báo và gây ra lỗi JSX.IntrinsicElements được báo cáo hay không; hoàn thành khi phần tử cục bộ được đổi tên mà không sửa đổi khai báo đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react, typescript
Lĩnh vực
developer-experience, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.