Skip to content

Commit

Permalink
fix: typescript.format.semicolons should not affect text interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Apr 18, 2022
1 parent ae8821f commit ce17114
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vue-code-gen/src/generators/template.ts
Expand Up @@ -23,7 +23,8 @@ const capabilitiesSet = {
const formatBrackets = {
empty: ['', ''] as [string, string],
round: ['(', ')'] as [string, string],
curly: ['{', '}'] as [string, string],
// fix https://github.com/johnsoncodehk/volar/issues/1210
curly: ['({ __VLS_foo:', '})'] as [string, string],
square: ['[', ']'] as [string, string],
};
const validTsVar = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
Expand Down Expand Up @@ -383,7 +384,7 @@ export function generate(
const context = node.loc.source.substring(2, node.loc.source.length - 2);
let start = node.loc.start.offset + 2;

tsCodeGen.addText(`{`);
tsCodeGen.addText(`(`);
writeInterpolation(
context,
start,
Expand All @@ -399,7 +400,7 @@ export function generate(
start,
formatBrackets.curly,
);
tsCodeGen.addText(`};\n`);
tsCodeGen.addText(`);\n`);
}
else if (node.type === CompilerDOM.NodeTypes.IF) {
// v-if / v-else-if / v-else
Expand Down

0 comments on commit ce17114

Please sign in to comment.