title: How to make VS Code build and run Rust programs?
body: <p>I've been using <a href="https://code.visualstudio.com/" rel="noreferrer" title="VS Code">VS Code</a>, and I was wondering how to build a <code>task.json</code> file that will have these commands. <code>cargo build</code>, <code>cargo run [ARGS]</code> <code>cargo run --release -- [ARGS]</code></p>
  
  <p>I've tried making one with the <a href="https://code.visualstudio.com/docs/tasks" rel="noreferrer" title="VS task.json documentationquot;">documentation</a> on <code>task.json</code>. I kept getting <code>No such subcommand</code> errors.</p>
  
  <p>Sample:</p>
  
  <pre><code>{
  "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"
  }]
  }
  </code></pre>