Closed danielo515 closed 1 month ago
This extension does not run inside Svelte files. Is it the code inside the Svelte files that get messed up?
Yes, it also breaks autocompletion in svelte files. The extension may not directly deal with svelte files, but if I disable it then the problem goes away
On Sun, 12 May 2024 at 08:02, Erika @.***> wrote:
This extension does not run inside Svelte files. Is it the code inside the Svelte files that get messed up?
— Reply to this email directly, view it on GitHub https://github.com/withastro/language-tools/issues/869#issuecomment-2106131715, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARKJWO3WFK3W63AN37GJVDZB4AXXAVCNFSM6AAAAABHSOJ5T6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGEZTCNZRGU . You are receiving this because you authored the thread.Message ID: @.***>
Does it break auto completions or does it break what you described in the first post?
It breaks automatic imports and refactors. Suggestions do work (but very bad)
On Sun, 12 May 2024 at 19:05, Erika @.***> wrote:
Does it break auto completions or does it break what you described in the first post?
— Reply to this email directly, view it on GitHub https://github.com/withastro/language-tools/issues/869#issuecomment-2106316195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARKJWNPTWTC4NFLAJSQ3Q3ZB6OOXAVCNFSM6AAAAABHSOJ5T6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGMYTMMJZGU . You are receiving this because you authored the thread.Message ID: @.***>
It seems to be some sort of conflict between the Svelte TypeScript plugin and the Astro one. It seems like both plugins are trying to do the refactor at the same time and so it ends up generating broken code. For what it's worth, you can actually undo the changes if you undo the move, and not the latest change. The LSPs are doing it correctly, as far as I can tell, just the TypeScript plugins.
I cannot reproduce a difference regarding auto imports / completions with or without the Astro plugin, so not sure on that one. Since auto imports in the respective files would be handled by the LSPs, I'm not sure how the Astro extension could affect the Svelte one in that regard.
This should be fixed in 2.9.1. Apologies for the inconvenience. If you have the time and would like to, I would appreciate if you updated your review on the VS Code marketplace to reflect this.
That is awesome! Thank you very much. I will update it, sorry about it. I wrote it in a moment where I was very frustrated
No worries, it happens! We're all humans here
Describe the Bug
When I move a svelte file that contains some typescript definitions, like an interface for example, many times the code gets messed, and if you undo, it will not go back to it's original state. This seems to be related to a bug in refactoring imports, because it happens when the language server tries to correct the imports.
Steps to Reproduce
npm init astro
This happens in VSCode by the way, not sure about other usages of the language server