Quickly compile, run, and debug individual Rust (.rs) files without needing Cargo or complex project setup. Perfect for beginners, quick prototyping, and learning Rust!
Compile and run your Rust file with a single command or keyboard shortcut.
Debug your Rust programs with breakpoints, variable inspection, and step-through execution.
Check your code for errors without compiling the full executable.
Click "βΆ Run" or "π Debug" directly above your main() function.
See your Rust version and quick access buttons right in the status bar.
Compiler errors and warnings appear in VS Code's Problems panel with clickable locations.
- Rust compiler (rustc) - Install from rustup.rs
- C/C++ Extension (optional) - Required for debugging support
- Install the extension from VS Code Marketplace
- Make sure
rustcis in your PATH - Open any
.rsfile and start coding!
| Command | Keybinding | Description |
|---|---|---|
| Rust Quick Run: Run File | Ctrl+Shift+R |
Compile and run the current file |
| Rust Quick Run: Debug File | F5 |
Compile with debug symbols and launch debugger |
| Rust Quick Run: Build File | Ctrl+Shift+B |
Compile only, create executable |
| Rust Quick Run: Check Syntax | - | Check for errors without full compilation |
| Rust Quick Run: Clean | - | Remove compiled files |
| Rust Quick Run: Set Arguments | - | Set command line arguments |
Right-click on any .rs file in the editor or explorer to access:
- Run Rust File
- Debug Rust File
- Build Rust File
When you have a fn main() in your file, you'll see clickable links above it:
βΆ Run | π Debug | π¨ Build
fn main() {
println!("Hello, world!");
}| Setting | Default | Description |
|---|---|---|
rustQuickRun.outputDirectory |
System temp | Directory for compiled executables |
rustQuickRun.optimizationLevel |
0 |
Optimization level (0, 1, 2, 3, s, z) |
rustQuickRun.showWarnings |
true |
Show compiler warnings |
rustQuickRun.clearTerminalBeforeRun |
true |
Clear terminal before running |
rustQuickRun.saveBeforeRun |
true |
Auto-save before compiling |
rustQuickRun.showCodeLens |
true |
Show Run/Debug above main() |
rustQuickRun.commandLineArguments |
"" |
Arguments to pass to your program |
fn main() {
println!("Hello, World!");
}Press Ctrl+Shift+R to run!
use std::env;
fn main() {
let args: Vec<String> = env::args().collect();
println!("Arguments: {:?}", args);
}Use "Set Arguments" command to pass arguments to your program.
use std::io;
fn main() {
println!("What's your name?");
let mut name = String::new();
io::stdin().read_line(&mut name).unwrap();
println!("Hello, {}!", name.trim());
}The integrated terminal handles input/output naturally.
- Set breakpoints by clicking in the gutter
- Press
F5or use "Debug File" command - Use the debug toolbar to step through code
- Inspect variables in the Debug sidebar
Note: Debugging requires the C/C++ extension for Windows (cppvsdbg) or GDB/LLDB for Linux/macOS.
Make sure rustc is installed and in your PATH:
rustc --versionIf not installed, visit rustup.rs.
- Install the C/C++ extension (
ms-vscode.cpptools) - On Linux, ensure GDB is installed:
sudo apt install gdb - On macOS, ensure LLDB is available (comes with Xcode)
Make sure the output directory is writable:
chmod 755 /tmp/rust-quick-run| Platform | Run | Debug |
|---|---|---|
| Windows | β | β (cppvsdbg) |
| macOS | β | β (lldb) |
| Linux | β | β (gdb) |
Contributions are welcome! Please visit our GitHub repository.
MIT License - see LICENSE for details.
See CHANGELOG.md for version history.
Enjoy quick Rust development! π¦
