microsoft / microsoft/TypeScript

Rename symbol renamed element declaration in node_modules

オープン
#63,450 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Needs More Info
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

.tsx ファイルで報告された JSX 要素のケースを使って Rename Symbol/F2 アクションを再現し、その後、node_modules/@types/react/index.d.ts にある影響を受けた宣言を調べます。名前変更によって宣言が変更され、報告された JSX.IntrinsicElements エラーが発生するかを確認します。ローカル要素がその宣言を変更せずに名前変更されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react, typescript
領域
developer-experience, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。