json - How to make VS Code build, and run Rust programs? -
i've been using vs code, , wondering how build task.json file have these commands. cargo build, cargo run [args] cargo run --release -- [args]
i've tried making 1 documentation on task.json. kept getting no such subcommand errors.
sample:
{ "version": "0.1.0", // command tsc. assumes tsc has been installed using npm install -g typescript "command": "cargo", // command shell script "isbuildcommand": true, // show output window 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" }] }
the command property support top level. in addition arguments have passed via args property. if put command command treated command whitespaces in name. example run task this:
{ "version": "0.1.0", "command": "cargo", "isshellcommand": true, // needed if cargo .cmd file "tasks": [ { "taskname": "run", "args": [ "--release" // more args ], "showoutput": "always" } ] }
Comments
Post a Comment