-
-
Notifications
You must be signed in to change notification settings - Fork 213
Closed
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working
Description
Describe the bug
When VSCode adds an import automatically, it adds it under the let { data }: { data: PageData } = $props();
, which then gets removed when saving, probably due to auto-formatting.
Reproduction
- Create a +page.svelte file
- Write this: (Normally you wouldn't add the "error" import yourself, it would be added by VSCode when adding that function in your code somewhere in the file.)
import type { PageData } from './$types';
let { data }: { data: PageData } = $props();
import { error } from '@sveltejs/kit';
- Save (or format file)
- This will result in the
let {data}
being deleted.
import { error } from '@sveltejs/kit';
import type { PageData } from './$types';
Expected behaviour
Either the import { error }
should be added before the let { data }
initially, or the formatting tool places it at the correct place and do not delete the let { data }
.
System Info
- OS: macOS 15.1
- IDE: VSCode 1.95.3
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
Metadata
Metadata
Assignees
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working