Skip to content

Commit

Permalink
fix(language-core): generate each interpolation into separate virtual…
Browse files Browse the repository at this point in the history
… code
  • Loading branch information
johnsoncodehk committed Mar 27, 2024
1 parent 0eccc7a commit 03637e9
Show file tree
Hide file tree
Showing 11 changed files with 389 additions and 278 deletions.
10 changes: 6 additions & 4 deletions packages/language-core/lib/generators/inlineCss.ts
Expand Up @@ -3,6 +3,11 @@ import { forEachElementNode } from './template';
import { enableAllFeatures } from './utils';
import type { Code } from '../types';

const codeFeatures = enableAllFeatures({
format: false,
structure: false,
});

export function* generate(templateAst: NonNullable<CompilerDOM.RootNode>): Generator<Code> {
for (const node of forEachElementNode(templateAst)) {
for (const prop of node.props) {
Expand All @@ -24,10 +29,7 @@ export function* generate(templateAst: NonNullable<CompilerDOM.RootNode>): Gener
content,
'template',
prop.arg.loc.start.offset + start,
enableAllFeatures({
format: false,
structure: false,
}),
codeFeatures,
];
yield ` }\n`;
}
Expand Down

0 comments on commit 03637e9

Please sign in to comment.