-
-
Notifications
You must be signed in to change notification settings - Fork 223
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 I use autoImport to import onMount or onDestroy or other things from Svelte, and we already have something imported (for example component, json, or some script, library) and we also have context="module" script in that .Svelte file, AutoImport missplace import in file, so it's out from <script> tag.
To Reproduce
<script context="module">
export let a;
</script>
<script>
import * as data from "../data/data.json";
onM| // | is position of cursor, where I press tab.
</script>
<div>{data}</div>in result, I get:
<script context="module">
export let a;
</script>
import { onMount } from 'Svelte'; // THIS IS BUG!!!
<script>
import * as data from "../data/data.json";
onMount()
</script>
<div>{data}</div>Expected behavior
<script context="module">
export let a;
</script>
<script>
import { onMount } from 'Svelte';
import * as data from "../data/data.json";
onMount()
</script>
<div>{data}</div>Screenshots
Not Screenshot, just whole video: https://www.youtube.com/watch?v=6Mz-xZq-ffs&feature=youtu.be
System (please complete the following information):
- OS: Ubuntu 20.04
- IDE: VS Code
- Plugin/Package: [Svelte for VS Code]
Additional context
(none)
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