diff --git a/extensions/vscode-vue-language-features/package.json b/extensions/vscode-vue-language-features/package.json index 7f84401c3..9bc1ecb34 100644 --- a/extensions/vscode-vue-language-features/package.json +++ b/extensions/vscode-vue-language-features/package.json @@ -176,6 +176,10 @@ "source.ts": "typescript", "source.js.jsx": "javascriptreact", "source.tsx": "typescriptreact", + "meta.tag.js": "jsx-tags", + "meta.tag.tsx": "jsx-tags", + "meta.tag.without-attributes.js": "jsx-tags", + "meta.tag.without-attributes.tsx": "jsx-tags", "source.json": "json", "source.json.comments": "jsonc", "source.yaml": "yaml", @@ -214,6 +218,10 @@ "source.ts": "typescript", "source.js.jsx": "javascriptreact", "source.tsx": "typescriptreact", + "meta.tag.js": "jsx-tags", + "meta.tag.tsx": "jsx-tags", + "meta.tag.without-attributes.js": "jsx-tags", + "meta.tag.without-attributes.tsx": "jsx-tags", "source.json": "json", "source.json.comments": "jsonc", "source.yaml": "yaml", diff --git a/plugins/typescript/src/index.ts b/plugins/typescript/src/index.ts index 6e64c8a2c..77ed7d2fa 100644 --- a/plugins/typescript/src/index.ts +++ b/plugins/typescript/src/index.ts @@ -59,7 +59,9 @@ export default function (): LanguageServicePlugin { if (config) { const tsLs = context.typescript.languageService; const close = tsLs.getJsxClosingTagAtPosition(shared.getPathOfUri(document.uri), document.offsetAt(position)); - return close?.newText; + if (close) { + return '$0' + close.newText; + } } } },