From 4b24a810f79c409c2ccc63ff61cd0e15bd52a05e Mon Sep 17 00:00:00 2001 From: KazariEX <1364035137@qq.com> Date: Wed, 18 Dec 2024 14:12:34 +0800 Subject: [PATCH] fix: skip type only --- packages/language-core/lib/parsers/scriptSetupRanges.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/language-core/lib/parsers/scriptSetupRanges.ts b/packages/language-core/lib/parsers/scriptSetupRanges.ts index 8e3b1ee257..162e939360 100644 --- a/packages/language-core/lib/parsers/scriptSetupRanges.ts +++ b/packages/language-core/lib/parsers/scriptSetupRanges.ts @@ -128,7 +128,10 @@ export function parseScriptSetupRanges( } if (namedBindings && ts.isNamedImports(namedBindings)) { for (const element of namedBindings.elements) { - if (element.propertyName?.text === 'default') { + if ( + !element.isTypeOnly + && element.propertyName?.text === 'default' + ) { importComponentNames.add(_getNodeText(element.name)); } }