Install the Rust toolchain with rustup, then add the rust-analyzer extension to VS Code for full language support.
- Install Rust and Cargo by running the installer script and accepting the default profile.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
- Install the
rust-analyzerextension from the VS Code Marketplace to enable code completion, diagnostics, and formatting. - Create a new Rust project using
cargo newto initialize the workspace structure.
cargo new my_project
- Open the project folder in VS Code to trigger the language server and start developing.
cd my_project
code .