Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable update imports on renaming files #40

Open
Theo-Steiner opened this issue Oct 12, 2021 · 3 comments
Open

Enable update imports on renaming files #40

Theo-Steiner opened this issue Oct 12, 2021 · 3 comments

Comments

@Theo-Steiner
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Collaborator

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
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants