From 6a54fc21155e4c063f457de346685d2b347a0894 Mon Sep 17 00:00:00 2001 From: KazariEX <1364035137@qq.com> Date: Tue, 24 Dec 2024 16:42:54 +0800 Subject: [PATCH 1/6] fix: intersect local `$slots` with `__VLS_ctx.$slots` --- .../language-core/lib/codegen/template/index.ts | 2 +- .../tsc/passedFixtures/vue3/#5082/main.vue | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test-workspace/tsc/passedFixtures/vue3/#5082/main.vue diff --git a/packages/language-core/lib/codegen/template/index.ts b/packages/language-core/lib/codegen/template/index.ts index 63bcdfa5d6..3b13f35395 100644 --- a/packages/language-core/lib/codegen/template/index.ts +++ b/packages/language-core/lib/codegen/template/index.ts @@ -86,7 +86,7 @@ function* generateSlots(options: TemplateCodegenOptions, ctx: TemplateCodegenCon yield `}${endOfLine}`; } const name = getSlotsPropertyName(options.vueCompilerOptions.target); - yield `var ${name}!: typeof ${options.slotsAssignName ?? '__VLS_slots'}${endOfLine}`; + yield `var ${name}!: typeof __VLS_ctx.${name} & typeof ${options.slotsAssignName ?? '__VLS_slots'}${endOfLine}`; } function* generateInheritedAttrs(ctx: TemplateCodegenContext): Generator { diff --git a/test-workspace/tsc/passedFixtures/vue3/#5082/main.vue b/test-workspace/tsc/passedFixtures/vue3/#5082/main.vue new file mode 100644 index 0000000000..a6f8698db6 --- /dev/null +++ b/test-workspace/tsc/passedFixtures/vue3/#5082/main.vue @@ -0,0 +1,15 @@ + + + + + From 210ac37e094aff22b43d0545966b8ed79c648838 Mon Sep 17 00:00:00 2001 From: KazariEX <1364035137@qq.com> Date: Tue, 24 Dec 2024 16:48:02 +0800 Subject: [PATCH 2/6] test: update --- .../tsc/passedFixtures/vue3/#5082/main.vue | 15 --------------- .../tsc/passedFixtures/vue3/slots/main.vue | 10 ++++++++-- 2 files changed, 8 insertions(+), 17 deletions(-) delete mode 100644 test-workspace/tsc/passedFixtures/vue3/#5082/main.vue diff --git a/test-workspace/tsc/passedFixtures/vue3/#5082/main.vue b/test-workspace/tsc/passedFixtures/vue3/#5082/main.vue deleted file mode 100644 index a6f8698db6..0000000000 --- a/test-workspace/tsc/passedFixtures/vue3/#5082/main.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/test-workspace/tsc/passedFixtures/vue3/slots/main.vue b/test-workspace/tsc/passedFixtures/vue3/slots/main.vue index ed4b9556f7..e02d348208 100644 --- a/test-workspace/tsc/passedFixtures/vue3/slots/main.vue +++ b/test-workspace/tsc/passedFixtures/vue3/slots/main.vue @@ -1,5 +1,8 @@