DEBUGGING, HOT RELOAD AND FORMATTER
- DEBUGGING (To observe each line of code)
- For Debugging in VSCode press Run and Debug.
- Create a launch json file.
- And click start debugging.
- HOT RELOAD (Reload code on change)
- For hot reload, install cargo-watch, by running below command in terminal:
cargo install cargo-watch
- Ater installing cargo-watch run the below command in terminal to start the code with hot reload and clippy.
cargo-watch -qc -x run -x clippy
- SETTING FORMATTER
- Go to .vscode folder and add a file named settings.json or press ctrl +shift+P and type workspace json.
- Add the below piece of json into that file
{
"[rust]": {
"editor.formatOnSave": true,
"editor.defaultFormattter: "rust-lang.rust-analyzer"
},
}
- Go to .vscode folder and add a file named settings.json or press ctrl +shift+P and type workspace json.
- Add the below piece of json into that file
{
"[rust]": {
"editor.formatOnSave": true,
"editor.defaultFormattter: "rust-lang.rust-analyzer"
},
}
Comments
Post a Comment