Skip to content

Commit

Permalink
fix(language-core): script syntax breaks if options are enclosed in p…
Browse files Browse the repository at this point in the history
…arentheses (vuejs#3756)
  • Loading branch information
johnsoncodehk authored and so1ve committed Dec 4, 2023
1 parent 6cf6cb0 commit ed5a1df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/language-core/src/generators/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export function generate(
return;

if (!!scriptSetup && scriptRanges?.exportDefault) {
addVirtualCode('script', scriptRanges.exportDefault.end, script.content.length);
addVirtualCode('script', scriptRanges.exportDefault.expression.end, script.content.length);
}
}
function generateScriptSetupImports() {
Expand Down
7 changes: 7 additions & 0 deletions test-workspace/tsc/vue3/#3756/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script setup lang="ts"></script>

<script lang="ts">
export default ({});
console.log();
</script>

0 comments on commit ed5a1df

Please sign in to comment.