diff --git a/packages/language-core/lib/codegen/template/context.ts b/packages/language-core/lib/codegen/template/context.ts index bf219f05b7..0a9d629d14 100644 --- a/packages/language-core/lib/codegen/template/context.ts +++ b/packages/language-core/lib/codegen/template/context.ts @@ -125,6 +125,8 @@ export function createTemplateCodegenContext(options: Pick(); const templateRefs = new Map(); return { @@ -140,7 +142,8 @@ export function createTemplateCodegenContext(options: Pick { } yield endOfLine; yield `var $attrs!: Partial & Record${endOfLine}`; + + if (ctx.bindingAttrLocs.length) { + yield `[`; + for (const loc of ctx.bindingAttrLocs) { + yield [ + loc.source, + 'template', + loc.start.offset, + ctx.codeFeatures.all + ]; + yield `,`; + } + yield `]${endOfLine}`; + } } function* generateRefs(ctx: TemplateCodegenContext): Generator {