coc-extensions / coc-svelte

svelte support for (Neo)Vim
MIT License
176 stars 24 forks source link

Enable update imports on renaming files #40

Open Theo-Steiner opened 2 years ago

Theo-Steiner commented 2 years ago

Hey there, when moving/ renaming a file that is imported by another file, the combination of watchman and coc-tsserver prompts you if you want to update the imports. The svelte vs code extension allows for the same thing. However, I can't get this to work for svelte files. I set svelte.plugin.svelte.rename to true, however this did not do anything. I assume I would need some sort of process to watch my files and notify coc-svelte?

Theo-Steiner commented 2 years ago

Okay, I learned yesterday that the svelte language server implements this like so since there apparently is no api in the lsp for this feature. I looked through the src code of this extension and didn't see an obvious way of how to implement this... So I assume it would be quite difficult to have this functionality?

davidroeca commented 2 years ago

This extension is largely just a fork of svelte-vscode, though there are some differences between coc and vscode that made it challenging to port certain features such as this one. I believe the line in question worth examining for further investigation would be this one here, but I’m not sure how easy it is to port. Can’t remember why I didn’t end up moving that code over.

If you want to dig into it, find an idea of how to port it, and/or want to try implement the feature, I’d be happy to review a PR!

artemYashin commented 11 months ago

Hi, did found a fork package which works fine. use:

:CocUninstall coc-svelte
:CocInstall @softmotions/coc-svelte