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

Updates to Cargo.toml not recognized

Open JoshMcguigan opened this issue 5 years ago • 4 comments

Thanks for your work on coc!

As of https://github.com/rust-lang/rls/pull/1246 rls supports cargo rebuilds, but this does not work in coc-rls.

To re-create this issue, create a new project, use a dependency in main.rs, wait for the error about the dependency being unrecognized, update Cargo.toml, see that the error doesn't go away.

Perhaps the issue is that when a language client instance is created we don't create a selector for toml files? https://github.com/neoclide/coc-rls/blob/master/src/index.ts#L74

JoshMcguigan avatar Nov 23 '19 12:11 JoshMcguigan

Tagging https://github.com/rust-lang/rls-vscode/issues/364 as perhaps the resolution is the same, although that issue seems to have been opened before rls supported this functionality.

JoshMcguigan avatar Nov 23 '19 12:11 JoshMcguigan

Playing a bit with Rust and found coc-rls. Ran into this while just working through the guessing game tutorial in the book after adding my first dependency. I'm not clear on if this project is being maintained and I don't have experience writing coc extensions or this comment would be accompanied by a PR, so I am sorry for resurrecting a very old issue in advance.

ernie avatar Apr 18 '22 21:04 ernie

Just a quick update: as a workaround, it's possible to run :CocCommand rls.restart when Cargo.toml changes, to avoid needing to relaunch the editor.

ernie avatar Apr 18 '22 22:04 ernie

Last update: by reviewing the changes that were made to vscode-rust, I discovered they'd moved to rust-analyzer, which can be installed by :CocInstall coc-rust-analyzer. Works great.

ernie avatar Apr 18 '22 22:04 ernie