https://www.forrestthewoods.com/blog/how-to-debug-rust-with-visual-studio-code/
Install Rust and VS Code
This should go without saying.
Install Rust
Install Visual Studio Code
Install VS Code Extensions
You'll need to install an extension. Which one depends on your platform.
C/C++ (Windows)
CodeLLDB (OS X / Linux)
It probably makes sense to go ahead and install the Rust extension as well.
Configure VS Code
Now that your tools are installed you need to configure your VS Code launch properties.
Click Debug -> Add Configuration
If you're on Windows then select C++ (Windows)
If you're on Mac or Linux then select LLDB: Custom Launch
This should create and open launch.json
. You'll have to manually change the executable name under "program".
Next, you should verify breakpoints are enabled. Some readers have reporting needing to this do. Some machines have it enabled by default. ?♂️
That's it!
Add a breakpoint. Press F5 to launch. Voila!