Skip to content

Instantly share code, notes, and snippets.

@whoisryosuke
Last active August 19, 2022 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whoisryosuke/b69835cdac085133656580efb5a4665d to your computer and use it in GitHub Desktop.
Save whoisryosuke/b69835cdac085133656580efb5a4665d to your computer and use it in GitHub Desktop.
Rust / VSCode - Tasks for Cargo Build and Check. CTRL + SHIFT + P, type Run Task, then select cargo run from list. This file goes in .vscode/tasks.json. @see: https://stackoverflow.com/questions/46885292/how-to-launch-a-rust-application-from-visual-studio-code
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "cargo check",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"check",
// "--release",
// "--",
// "arg1"
],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "cargo test",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"test",
// "--release",
// "--",
// "arg1"
],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "cargo run",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"run",
// "--release",
// "--",
// "arg1"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment