You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Svelte for VS Code, if you use await in a non-async non-function context outside the top level (i.e. for loop, if statement, block), and use the Quick Fix "Add async modifier to containing function", the script tag will be changed from <script ...> to <async script ...>.
CuriousCodingCanadian
changed the title
await prepended to <script> html tag when using vscode quick fix
async prepended to <script> html tag when using vscode quick fix
Jan 18, 2025
Describe the bug
When using Svelte for VS Code, if you use
await
in a non-async non-function context outside the top level (i.e. for loop, if statement, block), and use the Quick Fix "Add async modifier to containing function", the script tag will be changed from<script ...>
to<async script ...>
.Reproduction
Write the following code in a Svelte file:
The await keyword will be underlined with a red squiggly line. Hover over it, select "Quick fix", then "Add async modifier to containing function".
The containing script tag will be replaced with
<async script lang="ts">
.Expected behaviour
Either do not show the option to add async modifier to containing function in this context, or wrap the current context in a function or IIFE.
System Info
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
The text was updated successfully, but these errors were encountered: