diff --git a/packages/language-core/lib/parsers/scriptSetupRanges.ts b/packages/language-core/lib/parsers/scriptSetupRanges.ts index fc3696efd8..238caa0426 100644 --- a/packages/language-core/lib/parsers/scriptSetupRanges.ts +++ b/packages/language-core/lib/parsers/scriptSetupRanges.ts @@ -301,6 +301,9 @@ export function parseBindingRanges(ts: typeof import('typescript'), sourceFile: if (node.importClause.namedBindings) { if (ts.isNamedImports(node.importClause.namedBindings)) { for (const element of node.importClause.namedBindings.elements) { + if (element.isTypeOnly) { + continue; + } bindings.push(_getStartEnd(element.name)); } } diff --git a/test-workspace/tsc/#4353/main.vue b/test-workspace/tsc/#4353/main.vue new file mode 100644 index 0000000000..48998976fa --- /dev/null +++ b/test-workspace/tsc/#4353/main.vue @@ -0,0 +1,8 @@ + + +