只是想编译之后立刻运行,像sublime那样从文件读入后输出到下面控制台。
写了个tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"tasks": [
{
"taskName": "build",
"command": "g++",
"isShellCommand": true,
"args": [
"-o",
"${workspaceRoot}/main",
"${workspaceRoot}/main.cpp"
],
"showOutput": "always"
},
{
"taskName": "run",
"command": "${workspaceRoot}/main",
"isShellCommand": true,
"showOutput": "always"
}
]
}
为啥,第二个任务不会运行。。
Now VS Code tasks will not be executed continuously.
Solution:
Use external tools, such as scripting, msbuild, make, etc.
Configure debugging without adding breakpoints. After compiling, press F5 to run
Updated on 2017-03-02:
VS Code 1.10 supports combining multiple tasks, and you can also set shortcut keys for a single task.