From 438ef384b219910f44ae624d7f93274f8d6cdbf8 Mon Sep 17 00:00:00 2001 From: zhiyuanzmj <260480378@qq.com> Date: Mon, 19 Aug 2024 23:38:55 +0800 Subject: [PATCH] fix: test --- packages/language-core/lib/codegen/script/globalTypes.ts | 6 +++--- packages/language-core/lib/codegen/script/scriptSetup.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/language-core/lib/codegen/script/globalTypes.ts b/packages/language-core/lib/codegen/script/globalTypes.ts index d2c97869f7..987dfba52c 100644 --- a/packages/language-core/lib/codegen/script/globalTypes.ts +++ b/packages/language-core/lib/codegen/script/globalTypes.ts @@ -130,10 +130,10 @@ declare global { >; type __VLS_PrettifyGlobal = { [K in keyof T]: T[K]; } & {}; type __VLS_PickRefsExpose = T extends object - ? { [K in keyof T]: ('expose' extends keyof T[K] - ? Parameters[0] - : T[K] extends any[] + ? { [K in keyof T]: (T[K] extends any[] ? Parameters[0][] + : T[K] extends { expose?: (exposed: infer E) => void } + ? E : T[K]) | null } : never; } diff --git a/packages/language-core/lib/codegen/script/scriptSetup.ts b/packages/language-core/lib/codegen/script/scriptSetup.ts index 5d66e6ffd7..5fd42073d1 100644 --- a/packages/language-core/lib/codegen/script/scriptSetup.ts +++ b/packages/language-core/lib/codegen/script/scriptSetup.ts @@ -248,8 +248,8 @@ function* generateSetupFunction( yield* generateComponentProps(options, ctx, scriptSetup, scriptSetupRanges, definePropMirrors); yield* generateModelEmits(options, scriptSetup, scriptSetupRanges); yield* generateTemplate(options, ctx, false); - yield `type __VLS_Refs = ReturnType['refs']${endOfLine};`; - yield `type __VLS_Slots = ReturnType['slots']${endOfLine};`; + yield `type __VLS_Refs = ReturnType['refs']${endOfLine}`; + yield `type __VLS_Slots = ReturnType['slots']${endOfLine}`; if (syntax) { if (!options.vueCompilerOptions.skipTemplateCodegen && (options.templateCodegen?.hasSlot || scriptSetupRanges?.slots.define)) {