-
-
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
In my Svelte components, I put the <script> block after the markup. When I use the auto-import feature to import a new component, the language server adds a new <script> tag at the beginning of the file, which causes a compielr error.
To Reproduce
Start with this component:
<p>Hello World!</p>
<Foo />
<script>
import Foo from './Foo.svelte'
</script>After <Foo /> type the name of another component not yet imported, such as <Bar then let auto-complete finish the import.
Expected behavior
This should appear:
<p>Hello World!</p>
<Foo />
<Bar />
<script>
import Foo from './Foo.svelte'
import Bar from './Bar.svelte'
</script>Actual behavior
This appears instead (which causes a compiler error because you can't have more than 1 script tag):
<script>
import Bar from './Bar.svelte'
</script>
<p>Hello World!</p>
<Foo />
<Bar />
<script>
import Foo from './Foo.svelte'
</script>System (please complete the following information):
- OS: Linux
- IDE: VS Code
- Plugin/Package: svelte.svelte-vscode
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