coc-svelte icon indicating copy to clipboard operation
coc-svelte copied to clipboard

Enable update imports on renaming files

Open Theo-Steiner opened this issue 4 years ago • 3 comments

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 avatar Oct 12 '21 04:10 Theo-Steiner

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?

Theo-Steiner avatar Oct 13 '21 03:10 Theo-Steiner

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!

davidroeca avatar Oct 13 '21 03:10 davidroeca

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

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

artemYashin avatar Sep 21 '23 20:09 artemYashin