vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

Couldn't start client Rust Language Server

Open byteshiva opened this issue 5 years ago • 5 comments

I'm using rust 1.39.0 and installed it using rust version manager.

Now in vscode, I see the below error. Do I need to specific the rust path since the rust compiler or binary localtion would be different when installed using rust version manager.

Error Couldn't start client Rust Language Server

byteshiva avatar Nov 13 '19 14:11 byteshiva

This is somethong to with /bin/sh and the rustup can't be found in the $PATH.

lihz6 avatar Jan 03 '20 14:01 lihz6

Command failed: rustup toolchain list /bin/sh: rustup: command not found

lihz6 avatar Jan 03 '20 14:01 lihz6

I got the same problem on macOS. I checked which rustup using $ sh, $ bash and $ zsh. Rustup is always found under /Users/user/.cargo/bin/rustup. So it does not seem to be a $PATH problem. rls is also found /Users/user/.cargo/bin/rls.

UPDATE: I solved this problem by explicitly setting "rust-client.rustupPath": "/Users/user/.cargo/bin/rustup".

eratio08 avatar Feb 24 '20 09:02 eratio08

Thanks to @eratio08 's comment, I also fixed this issue by going to ~/Library/Application Support/Code/User/settings.json and explicitly adding "rust-client.rlsPath": "/Users/NathanielRuiz/.cargo/bin/rls".

(You can also do this in Ctrl + Shift + P -> Preferences: Open User Settings)

NathanielRN avatar Jan 14 '21 01:01 NathanielRN

I also had to add the ~/.cargo/bin to my path, in addition to specifying the rust-client.rlsPath in the config, with rust v1.59

moloch-- avatar Apr 07 '22 20:04 moloch--