From 29f1d5f30c983d91a95083686a5711db1bbf3c51 Mon Sep 17 00:00:00 2001 From: KazariEX <1364035137@qq.com> Date: Wed, 25 Dec 2024 00:53:32 +0800 Subject: [PATCH] fix: align types of `v-for` with core --- .../language-core/lib/codegen/globalTypes.ts | 11 ++--- .../tsc/passedFixtures/vue3/v-for/main.vue | 46 +++++++------------ 2 files changed, 21 insertions(+), 36 deletions(-) diff --git a/packages/language-core/lib/codegen/globalTypes.ts b/packages/language-core/lib/codegen/globalTypes.ts index ac0a213671..4164dc876e 100644 --- a/packages/language-core/lib/codegen/globalTypes.ts +++ b/packages/language-core/lib/codegen/globalTypes.ts @@ -99,23 +99,20 @@ export function generateGlobalTypes(lib: string, target: number, strictTemplates >>; type __VLS_UseTemplateRef = Readonly>; - function __VLS_getVForSourceType(source: number): [number, number, number][]; - function __VLS_getVForSourceType(source: string): [string, number, number][]; + function __VLS_getVForSourceType(source: number): [number, number][]; + function __VLS_getVForSourceType(source: string): [string, number][]; function __VLS_getVForSourceType(source: T): [ item: T[number], - key: number, index: number, ][]; function __VLS_getVForSourceType }>(source: T): [ item: T extends { [Symbol.iterator](): Iterator } ? T1 : never, - key: number, - index: undefined, + index: number, ][]; // #3845 function __VLS_getVForSourceType }>(source: T): [ item: number | (Exclude extends { [Symbol.iterator](): Iterator } ? T1 : never), - key: number, - index: undefined, + index: number, ][]; function __VLS_getVForSourceType(source: T): [ item: T[keyof T], diff --git a/test-workspace/tsc/passedFixtures/vue3/v-for/main.vue b/test-workspace/tsc/passedFixtures/vue3/v-for/main.vue index 720c91ce46..b1d07e74e0 100644 --- a/test-workspace/tsc/passedFixtures/vue3/v-for/main.vue +++ b/test-workspace/tsc/passedFixtures/vue3/v-for/main.vue @@ -1,65 +1,53 @@