Originally published on php2rust.dev — part of the PHP to Rust course. View this lesson on the original site.
VS Code is one of the most popular editors for Rust development due to its lightweight design, extensibility, and excellent Rust support.
To get started, download and install VS Code from the official website:
- Choose the version for your operating system (Windows, macOS, or Linux).
- Follow the installation prompts.
- Once installed, open VS Code.
Essential extensions
For a smooth Rust development experience, install the following extensions:
-
Rust Analyzer, Provides intelligent code completion, error checking, go-to definitions, and code formatting. To install:
- Open VS Code.
- Press
Ctrl + Shift + X(orCmd + Shift + Xon macOS) to open the Extensions Marketplace. - Search for "Rust Analyzer" and click Install.
-
Even Better TOML, Adds syntax highlighting and validation for
.tomlfiles (used inCargo.toml). -
Dependi (optional), Helps you work with dependencies in
Cargo.toml: see versions, check for updates, and spot known vulnerabilities. The older Crates extension is deprecated in favour of Dependi; if you still have Crates installed, VS Code may prompt you to switch.
What's next
You're ready to write your first program. Next: Hello Rust.
From PHP to Rust — Getting Started with Rust