File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
packages/language-core/lib/codegen Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -102,16 +102,17 @@ export function* generateTemplateComponents(options: ScriptCodegenOptions): Gene
102102 }
103103
104104 exps . push ( `{} as NonNullable<typeof __VLS_internalComponent extends { components: infer C } ? C : {}>` ) ;
105- exps . push ( `{} as __VLS_GlobalComponents` ) ;
106105 exps . push ( `__VLS_ctxBase` ) ;
107106
108- yield `const __VLS_components = {${ newLine } ` ;
107+ yield `const __VLS_localComponents = {${ newLine } ` ;
109108 for ( const type of exps ) {
110109 yield `...` ;
111110 yield type ;
112111 yield `,${ newLine } ` ;
113112 }
114113 yield `}${ endOfLine } ` ;
114+
115+ yield `let __VLS_components: typeof __VLS_localComponents & __VLS_GlobalComponents${ endOfLine } ` ;
115116}
116117
117118export function * generateTemplate (
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ export function* generateTemplate(options: TemplateCodegenOptions): Generator<Co
125125 }
126126 components . add ( node . tag ) ;
127127 yield newLine ;
128- yield ` & __VLS_WithComponent<'${ getCanonicalComponentName ( node . tag ) } ', typeof __VLS_components , ` ;
128+ yield ` & __VLS_WithComponent<'${ getCanonicalComponentName ( node . tag ) } ', typeof __VLS_localComponents , ` ;
129129 yield getPossibleOriginalComponentNames ( node . tag , false )
130130 . map ( name => `"${ name } "` )
131131 . join ( ', ' ) ;
You can’t perform that action at this time.
0 commit comments