VSCode addMissingImports
on save adds imports to bottom of file instead of the script block
#4586
Labels
bug
Something isn't working
good reproduction ✨
This issue provides a good reproduction, we will be able to investigate it first
upstream
Vue - Official extension or vue-tsc version
2.0.26
VSCode version
1.91.0
Vue version
3.4.30
TypeScript version
5.5.2
System Info
Steps to reproduce
Enable imports on save in VSCode settings
Export a string test
In a Vue file, use it in both a computed and a normal const
Save the file and imports get added to bottom
What is expected?
Import is added to top of script block
What is actually happening?
Import is added at the bottom of the file
Link to minimal reproduction
No response
Any additional comments?
I've also had this happen when moving files, that imports are added to the bottom of the file instead of the top of the script block.
It does work correctly if you remove either the constant or the computed. Saving this
or
Produces the correct result, for example:
The text was updated successfully, but these errors were encountered: