File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as vscode from "vscode";
2
2
import * as toolchain from "./toolchain" ;
3
3
import type { Config } from "./config" ;
4
4
import { log } from "./util" ;
5
- import { unwrapUndefinable } from "./undefinable" ;
5
+ import { expectNotUndefined , unwrapUndefinable } from "./undefinable" ;
6
6
7
7
// This ends up as the `type` key in tasks.json. RLS also uses `cargo` and
8
8
// our configuration should be compatible with it so use the same key.
@@ -145,11 +145,13 @@ async function cargoToExecution(
145
145
const cargoPath = await toolchain . cargoPath ( ) ;
146
146
const cargoCommand = definition . overrideCargo ?. split ( " " ) ?? [ cargoPath ] ;
147
147
148
- const args = [ definition . command ] . concat ( definition . args ?? [ ] ) ;
149
- const fullCommand = [ ...cargoCommand , ...args ] ;
150
- const processName = unwrapUndefinable ( fullCommand [ 0 ] ) ;
148
+ const args = expectNotUndefined (
149
+ definition . args ,
150
+ "args were not provided via runnables; this is a bug." ,
151
+ ) ;
152
+ const processName = unwrapUndefinable ( cargoCommand [ 0 ] ) ;
151
153
152
- return new vscode . ProcessExecution ( processName , fullCommand . slice ( 1 ) , {
154
+ return new vscode . ProcessExecution ( processName , args , {
153
155
cwd : definition . cwd ,
154
156
env : definition . env ,
155
157
} ) ;
You can’t perform that action at this time.
0 commit comments