Microsoft/vscode

Deleting JSX tag name and then typing a different tag name doesn't update closing tag

开放

#247,235 创建于 2025年4月23日

 (9 条评论) (0 个反应) (1 位负责人)TypeScript (39,847 个派生)batch import
bugeditor-synced-regionenhancementhelp wanted

仓库指标

星标
 (184,936 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Does this issue occur when all extensions are disabled?: Yes/No

  • VSCode Version: 1.99.3 (Universal)
  • OS Version: Darwin x64 24.3.0

Steps to Reproduce:

  1. Go to the end of the name of an opening JSX/TSX tag
  2. Backspace to delete the name
  3. Type the new name
  4. The closing tag should also be updated but it remains blank

This is really annoying and I'm confused why I can't find any other issue reports about it. Maybe a lot of people select the tag name before typing over it, but that workaround is no good for Vim users (for whom it's most efficient to cw at the start of the tag, which deletes it and goes into insert mode, and then type the new tag name).

VSCode could make this work even though the syntax temporarily becomes invalid when the tag name has been deleted; all it would take is remembering the opening/closing tag name positions when all characters in the tag name get deleted, and keeping that in memory until the next document edit.

https://github.com/user-attachments/assets/35c21b5f-a64f-4d56-8933-dfc5f3f65f88

贡献者指南