4580: Fix invoking cargo without consulting CARGO env var or standard installation paths r=matklad a=Veetaha

Followup for #4329

The pr essentially fixes [this bug](https://youtu.be/EzQ7YIIo1rY?t=2189)

cc @lefticus

Co-authored-by: veetaha <veetaha2@gmail.com>
This commit is contained in:
bors[bot] 2020-06-02 11:58:28 +00:00 committed by GitHub
commit 131ccd9540
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 140 additions and 81 deletions

View file

@ -1,6 +1,7 @@
import * as vscode from 'vscode';
import * as lc from 'vscode-languageclient';
import * as ra from './lsp_ext';
import * as toolchain from "./toolchain";
import { Ctx, Cmd } from './ctx';
import { startDebugSession, getDebugConfiguration } from './debug';
@ -175,7 +176,7 @@ export function createTask(spec: ra.Runnable): vscode.Task {
const definition: CargoTaskDefinition = {
type: 'cargo',
label: spec.label,
command: spec.bin,
command: toolchain.getPathForExecutable(spec.kind),
args: spec.extraArgs ? [...spec.args, '--', ...spec.extraArgs] : spec.args,
env: Object.assign({}, process.env, spec.env),
};