Microsoft/vscode

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

Open

#247,235 建立於 2025年4月23日

在 GitHub 查看
 (9 留言) (0 反應) (1 負責人)TypeScript (74,848 star) (10,221 fork)batch import
bugeditor-synced-regionhelp wanted

描述

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

貢獻者指南