rust-lang / vscode-rust

Rust extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
Other
1.39k stars 167 forks source link

Couldn't start client Rust Language Server #700

Open byteshiva opened 4 years ago

byteshiva commented 4 years ago

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

lihz6 commented 4 years ago

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

lihz6 commented 4 years ago
Command failed: rustup toolchain list /bin/sh: rustup: command not found
eratio08 commented 4 years ago

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".

NathanielRN commented 3 years ago

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)

moloch-- commented 2 years ago

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