🏷️

Auto Rename Tag, Auto Close Tagはもう必要ない

2024/09/03に公開

結論

settings.jsonに以下設定を記述すればOK

settings.json
{
  ...,
  "editor.linkedEditing": true,
  "html.autoClosingTags": true,
  "javascript.autoClosingTags": true,
  "typescript.autoClosingTags": true,
  ...,
}

概要

よく見る「おすすめ拡張機能○選!!」みたいな記事でほぼ確実に取り扱われているAuto Rename TagAuto Close Tag。(または二つの拡張機能が内包されたAuto Complete Tag)

Auto Rename TagについてはVSCode v1.44から、Auto Close TagについてはVSCode v1.16からVSCodeのデフォルトの機能にビルトインされているみたいです。

Auto Close Tag

https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag

From VS Code 1.16, it has built-in close tag support for HTML, Handlebars and Razor files. This extension is enabled for other languages like XML, PHP, Vue, JavaScript, TypeScript, JSX, TSX and so on. It is configurable.

Auto Rename Tag

https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag

From 1.44, VS Code offers the built-in auto update tags support for HTML and Handlebars that can be enabled with the setting editor.linkedEditing. If this setting is enabled, this extension will skip HTML and Handlebars files regardless of the languages listed in auto-rename-tag.activationOnLanguage

GitHubで編集を提案
SMARTCAMP Engineer Blog

Discussion