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
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.
The problem is that, while you're in the middle of typing, the code is an error-state (unclosed tag). Because of that, everything after the unclosed-tag is treated as the child of that tag - including the top level script tag. Therefore the intellisense thinks there's no top level script tag yet and creates one. We need to investage if we can check if that tag is not closed and try to mark the children as top level so the script is recognized correctly.
dummdidumm
pushed a commit
to dummdidumm/language-tools
that referenced
this issue
Sep 26, 2020
Tries to parse the HTML document and work around the limitations of the underlying parser which will trip up when there's a non-closed tag and treat everything afterwards as its child.
sveltejs#547
- Parser got better: Now sees `<` as start of other opening tag. sveltejs#547, closessveltejs#578
- New option to not provide default data provider which removes duplicate suggestions
- Parser got better: Now sees `<` as start of other opening tag. #547, closes#578
- New option to not provide default data provider which removes duplicate suggestions
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:
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:
Actual behavior
This appears instead (which causes a compiler error because you can't have more than 1 script tag):
System (please complete the following information):
The text was updated successfully, but these errors were encountered: