From 778c197a73ea811e7a47ef821338680f10003c62 Mon Sep 17 00:00:00 2001 From: KazariEX <1364035137@qq.com> Date: Mon, 5 Aug 2024 00:02:39 +0800 Subject: [PATCH 1/3] fix: avoid converting internal id of special tags --- packages/language-service/lib/plugins/vue-template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/language-service/lib/plugins/vue-template.ts b/packages/language-service/lib/plugins/vue-template.ts index 7d67146123..6044277c0d 100644 --- a/packages/language-service/lib/plugins/vue-template.ts +++ b/packages/language-service/lib/plugins/vue-template.ts @@ -424,7 +424,7 @@ export function create( if (specialTags.has(tag.name)) { tag.name = createInternalItemId('specialTag', [tag.name]); } - if (casing.tag === TagNameCasing.Kebab) { + else if (casing.tag === TagNameCasing.Kebab) { tag.name = hyphenateTag(tag.name); } else { From cfd3ad1369021f1dd7b3f0c62e79497234a22749 Mon Sep 17 00:00:00 2001 From: KazariEX <1364035137@qq.com> Date: Mon, 5 Aug 2024 00:18:34 +0800 Subject: [PATCH 2/3] fix: use continue --- packages/language-service/lib/plugins/vue-template.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/language-service/lib/plugins/vue-template.ts b/packages/language-service/lib/plugins/vue-template.ts index 6044277c0d..1c35d8ed42 100644 --- a/packages/language-service/lib/plugins/vue-template.ts +++ b/packages/language-service/lib/plugins/vue-template.ts @@ -423,6 +423,7 @@ export function create( for (const tag of builtInData.tags) { if (specialTags.has(tag.name)) { tag.name = createInternalItemId('specialTag', [tag.name]); + continue; } else if (casing.tag === TagNameCasing.Kebab) { tag.name = hyphenateTag(tag.name); From 8b05917f7bb4ceca9f6b6ace40daac0143da111e Mon Sep 17 00:00:00 2001 From: KazariEX <1364035137@qq.com> Date: Mon, 5 Aug 2024 00:42:14 +0800 Subject: [PATCH 3/3] fix: skip second determine --- packages/language-service/lib/plugins/vue-template.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/language-service/lib/plugins/vue-template.ts b/packages/language-service/lib/plugins/vue-template.ts index 1c35d8ed42..ebc41c67d2 100644 --- a/packages/language-service/lib/plugins/vue-template.ts +++ b/packages/language-service/lib/plugins/vue-template.ts @@ -421,9 +421,12 @@ export function create( if (builtInData.tags) { for (const tag of builtInData.tags) { + if (isInternalItemId(tag.name)) { + continue; + } + if (specialTags.has(tag.name)) { tag.name = createInternalItemId('specialTag', [tag.name]); - continue; } else if (casing.tag === TagNameCasing.Kebab) { tag.name = hyphenateTag(tag.name); @@ -869,8 +872,12 @@ function createInternalItemId(type: 'componentEvent' | 'componentProp' | 'specia return '__VLS_::' + type + '::' + args.join(','); } +function isInternalItemId(key: string) { + return key.startsWith('__VLS_::'); +} + function readInternalItemId(key: string) { - if (key.startsWith('__VLS_::')) { + if (isInternalItemId(key)) { const strs = key.split('::'); return { type: strs[1] as 'componentEvent' | 'componentProp' | 'specialTag',