I want do develop C programs with vscode.
My tasks.json
, which describes the build stage if I understood that correctly, looks like this:
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"runOptions": {
"runOn": "default"
}
}
]
}
Since all the compiler errors are generated by the build, I would like to run it every time I save the file. This allows me to get immediate compiler feedback.
How can I set this up this? Note that most Plugins like Run on Save don't work, since I can't specify the task, just the command, and then I won't get the compiler errors.