mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Removed unnecessary extraArgs for cargo invocation
This commit is contained in:
parent
10836543d6
commit
11e9e4b1fb
2 changed files with 3 additions and 6 deletions
|
@ -55,12 +55,9 @@ export class Cargo {
|
||||||
return artifacts;
|
return artifacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async executableFromArgs(cargoArgs: string[], extraArgs?: string[]): Promise<string> {
|
public async executableFromArgs(args: string[]): Promise<string> {
|
||||||
|
let cargoArgs = [...args]; // to remain args unchanged
|
||||||
cargoArgs.push("--message-format=json");
|
cargoArgs.push("--message-format=json");
|
||||||
if (extraArgs) {
|
|
||||||
cargoArgs.push('--');
|
|
||||||
cargoArgs.push(...extraArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
const artifacts = await this.artifactsFromArgs(cargoArgs);
|
const artifacts = await this.artifactsFromArgs(cargoArgs);
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ async function getCppvsDebugConfig(config: ra.Runnable, sourceFileMap: Record<st
|
||||||
debugOutput.clear();
|
debugOutput.clear();
|
||||||
|
|
||||||
const cargo = new Cargo(config.cwd || '.', debugOutput);
|
const cargo = new Cargo(config.cwd || '.', debugOutput);
|
||||||
const executable = await cargo.executableFromArgs(config.args, config.extraArgs);
|
const executable = await cargo.executableFromArgs(config.args);
|
||||||
|
|
||||||
// if we are here, there were no compilation errors.
|
// if we are here, there were no compilation errors.
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue