Assume that you have installed Rust in your computer. If you need guidance on how to install and configure Rust, you can find it here and of course Visual Studio Code installed as well.
Configuring Visual Studio Code for Rust development isn't difficult. Hopefully this guidance is useful to help you in Rust development. Let's start.
Install Visual Studio Code Extension
1. You need to install extension according to you platform
- C/C++ (for Windows)
- CodeLLDB (for MacOS/Linux)
since I used Ubuntu Linux then I installed CodeLLDB as shown as below
2. Install Rust (rls) - For Auto Complete
3. Install Rust Analyzer
Debugging The Code
Now, you can use VS Code for Rust development. Let's try by creating new project via console
❯ cargo new helloworld
Created binary (application) `helloworld` package
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "helloworld",
"args": [],
"program": "${workspaceFolder}/target/debug/helloworld",
"windows": {
"program": "${workspaceFolder}/target/debug/helloworld.exe"
},
"cwd": "${workspaceFolder}",
"stopOnEntry": false,
"sourceLanguages": [
"rust"
]
}
]
}
Thanks for share
ReplyDeletevery cool article
Mantap Bro!!
ReplyDeleteMantap Bro!!
ReplyDelete