From e4149adfb95caa70bae7402a6d17fb7dddba463f Mon Sep 17 00:00:00 2001 From: KazariEX <1364035137@qq.com> Date: Wed, 1 Jan 2025 00:07:36 +0800 Subject: [PATCH] refactor: filter --- packages/language-service/lib/plugins/vue-template.ts | 4 +--- packages/typescript-plugin/lib/requests/componentInfos.ts | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/language-service/lib/plugins/vue-template.ts b/packages/language-service/lib/plugins/vue-template.ts index d85a4bf8f1..f1d26d468b 100644 --- a/packages/language-service/lib/plugins/vue-template.ts +++ b/packages/language-service/lib/plugins/vue-template.ts @@ -569,9 +569,7 @@ export function create( !prop.name.startsWith('ref_') ), events, - directives: directives.filter(name => - !['vBind', 'vIf', 'vOn', 'VOnce', 'vShow', 'VSlot'].includes(name) - ), + directives, }); version++; })()); diff --git a/packages/typescript-plugin/lib/requests/componentInfos.ts b/packages/typescript-plugin/lib/requests/componentInfos.ts index b0f6d1b992..1df0adcd5b 100644 --- a/packages/typescript-plugin/lib/requests/componentInfos.ts +++ b/packages/typescript-plugin/lib/requests/componentInfos.ts @@ -139,7 +139,8 @@ export function getComponentDirectives( return directives.type.getProperties() .map(({ name }) => name) - .filter(name => name.startsWith('v') && name.length >= 2 && name[1] === name[1].toUpperCase()); + .filter(name => name.startsWith('v') && name.length >= 2 && name[1] === name[1].toUpperCase()) + .filter(name => !['vBind', 'vIf', 'vOn', 'VOnce', 'vShow', 'VSlot'].includes(name)); } export function getComponentNames(