Skip to content

Commit

Permalink
fix(language-service): avoid converting internal id of special tags (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX authored Aug 9, 2024
1 parent 98b7759 commit 35474d2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/language-service/lib/plugins/vue-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,14 @@ 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]);
}
if (casing.tag === TagNameCasing.Kebab) {
else if (casing.tag === TagNameCasing.Kebab) {
tag.name = hyphenateTag(tag.name);
}
else {
Expand Down Expand Up @@ -881,8 +885,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',
Expand Down

0 comments on commit 35474d2

Please sign in to comment.