vscode-rust
vscode-rust copied to clipboard
couldn't start client Rust Language Server
Hi,
I just installed the 0.61 plugin and am running into the "couldn't start client rust language server" error. I have put the "rust-client.channel": "stable" into my settings.json and can run rustup from terminal spawned inside vsc. Please see the attached screenshot. Any idea on how to resolve this?
Nevermind, I quit code and restarted it and it's now working.
I had the same error with rust-client.channel
being undefined. It's especially bad with first time (Rust/vscode) users. It would really help to have a default stable
.
I had the same issue. And vscode kept telling me "rls building".
After I set up the "rust-client.channel" and "rust-client.rustupPath" manually, both problems are solved. Perhaps this would be helpful.
Add this line to setting.json
might solve this problem:
"rust-client.rustupPath": "$HOME/.cargo/bin/rustup"
If you change the path during installation, just replace it with your own path.
btw, the default value is rustup
, this is obviously not available.
I am using macOS catalina, but I think it should work at most of UNIX-like OS.
I had this error, and @parrotdance thanks for your solution, it works! A little bit weird it's not working out of the box, though...
@parrotdance Thanks! For others on the struggle bus, I found that you have to restart/reload VSCode for the setting to kick in.
@JerryGreen
Search rustup path
in setting and it will show you a elegant way.
The real weird stuff is, the default value works well in Windows, anyone gonna resolve this?
If this is a problem with macOS then it's probably down to the weird way that macOS handles $PATH. Specifically, the value that gets loaded for an app launched from dock or spotlight is not the same as the value that gets loaded for a terminal session. Under normal (default) install conditions, VSCode on macOS will not be able to find rustup
.
I am on Windows 10 (May 2020 release 2004) and I am experiencing the same issue.
I am on Windows 10 (May 2020 release 2004) and I am experiencing the same issue.
- install rls
- config rustupPath
if wsl choose config of remote wsl
Everything works fine for me after add this:
{ "rust-client.channel": "stable", "rust-client.rustupPath": "$HOME/.cargo/bin/rustup" }
to my config, i´m using Ubuntu 20 with WSL2 on windows 10
Same on Fedora 31. I installed rust from package manager, so I have no rustup in the system.
i've solved it setting this in the local settings.json
file "rust-client.disableRustup": true
"rust-client.channel": "stable"
seemed to be the magic sauce for me, thanks @eutobias 🎉
Too bad this isn't working out of the box 😢
Nevermind, I quit code and restarted it and it's now working.
Thanks. This worked for me.
If you use brew
installation, configure it in settings.json
as follows:
{
// Rust configure
"rust-client.channel": "stable", // Channel
"rust-client.rlsPath": "/opt/homebrew/opt/rust-analyzer/bin/rust-analyzer", // Language server
"rust-client.disableRustup": true,
// "rust-client.rustupPath": "$HOME/.cargo/bin/rustup",
}
@0x1af2aec8f957 to use rust-analyzer, please use the rust-analyzer extension right now. The VSCode-Rust extension doesn't work very well with RA at the moment.
I guess in addition to the answers above you can also just run the below as sudo (assuming here you're on a Mac):
$HOME/.cargo/bin/rustup component add rust-analysis --toolchain stable
$HOME/.cargo/bin/rustup component add rust-src --toolchain stable
$HOME/.cargo/bin/rustup component add rls --toolchain stable
You probably shouldn't run rustup with sudo, since it sets up per-user toolchains, so you'll get one installed for root.
I met this issue with Windows today. Before yesterday, it worked quite well.
After I manual add path of rust
in ENV, it is solved.