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

I can’t use the rust toolchain from wsl (ubuntu for windows) #863

Open rambip opened 3 years ago

rambip commented 3 years ago

I installed a while ago the rust toolchain in windows ubuntu. I created a rust project inside VS code, and I would like to use the tools I installed on the Linux distribution, without reinstalling the tools on windows. Is that possible?

erdeszt commented 3 years ago

You need to install the Remote WSL extension in VSCode and open your rust project folder in wsl (bottom left corner of VSCode). Once that's done you need to install the Rust extension for WSL (in the extension manager). It works fine for me.

rambip commented 3 years ago

Thanks ! The rust extension for wsl didn't work for me (it asked me to download something and that didn't work)

> Executing task: rustup toolchain install wsl.exe < error: invalid toolchain name: 'wsl.exe' The terminal process "/bin/bash '-c', 'rustup toolchain install wsl.exe'" failed to launch (exit code: 1).

I tried the rust analyser extension for wsl instead and that works really well.