【发布时间】:2015-06-03 18:11:35
【问题描述】:
我一直在使用VS Code,我想知道如何构建一个包含这些命令的task.json 文件。 cargo build, cargo run [ARGS] cargo run --release -- [ARGS]
我尝试在task.json 上使用documentation 制作一个。我不断收到No such subcommand 错误。
示例:
{
"version": "0.1.0",
// The command is tsc. Assumes that tsc has been installed using npm install -g typescript
"command": "cargo",
// The command is a shell script
"isBuildCommand": true,
// Show the output window only if unrecognized errors occur.
"showOutput": "silent",
"tasks": [{
"taskName": "run test",
"version": "0.1.0",
"command": "run -- --exclude-dir=node_modules C:/Users/Aaron/Documents/Github/",
"isShellCommand": true,
"showOutput": "always"
},
{
"taskName": "run",
"version": "0.1.0",
"args": [ "--"
, "--exclude-dir=node_modules"
, "C:/Users/Aaron/Documents/Github/"
]
"isShellCommand": true,
"showOutput": "always"
}]
}
【问题讨论】:
-
也许你可以在这个 reddit 线程中找到一些灵感:reddit.com/r/rust/comments/389d3o/…
-
我已经删除了我的答案,但更新了要点(抱歉代码粘贴错误)gist.github.com/vilic/f756ccfdb91b004e7a70。使用node执行另一个脚本的原因是Visual Studio Code问题匹配器无法处理多行错误,所以我需要做一些中间的事情。