The VS Code Rust Helper is a Visual Studio Code extension that provides various Rust-related commands to streamline development. It allows users to create new Rust projects, build for different targets, and download additional support files.
- Create a Rust Project: Easily initialize a new Rust project.
- Build for WebAssembly (wasm32): Compile Rust projects for WebAssembly.
- Build for Linux (x86_64-unknown-linux-gnu): Compile Rust projects for Linux.
- Download Rust Objects: Automatically install missing Rust objects to use.
- Check Web Dependencies: Verify and install required tools for web builds.
Before building for web, ensure you have the required tools:
- Install the WebAssembly target:
rustup target add wasm32-unknown-unknown- Install wasm-bindgen-cli:
cargo install wasm-bindgen-cliYou can use the "Check Web Dependencies" command in the extension to automatically install these.
To build Windows applications, you need to add Windows support first:
sudo pacman -S mingw-w64-gcc
rustup target add x86_64-pc-windows-gnuFor Web output you must add web support to the computer before you can build it with:
rustup target add wasm32-unknown-unknownNOTE: This is different than adding web-support to the program. This needs to be done once on the PC where the command in the VS code extension must be done for each program.
This error typically occurs when:
wasm-bindgen-cliis not installed or is an incompatible version- The WebAssembly target is not properly configured
- Missing web-specific dependencies in Cargo.toml
Solutions:
- Use the "Check Web Dependencies" command to install required tools
- Ensure your project has web support added via "Add Web Support" command
- Try updating wasm-bindgen:
cargo install wasm-bindgen-cli --force - Make sure you're using compatible versions of macroquad and wasm-bindgen
- Build timeouts: Increase your network timeout if downloading dependencies fails
- Permission issues: Ensure you have write permissions in your project directory
- Missing dependencies: The extension automatically adds required dependencies to new projects
- Download vsix file from:
https://github.com/Mathew-D/vs_code_rust
Feel free to fork the repository, open issues, and submit pull requests to improve the extension.
This project is licensed under the MIT License.