Skip to content

Commit cfc9d5c

Browse files
committed
Pass flycheck extra args when running build scripts
1 parent 70e10de commit cfc9d5c

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

crates/project-model/src/build_scripts.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ impl WorkspaceBuildScripts {
6767
let mut cmd = Command::new(toolchain::cargo());
6868

6969
cmd.args(["check", "--quiet", "--workspace", "--message-format=json"]);
70+
cmd.args(&config.extra_args);
7071

7172
// --all-targets includes tests, benches and examples in addition to the
7273
// default lib and bins. This is an independent concept from the --target

crates/project-model/src/cargo_workspace.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ pub struct CargoConfig {
105105
pub wrap_rustc_in_build_scripts: bool,
106106
/// The command to run instead of `cargo check` for building build scripts.
107107
pub run_build_script_command: Option<Vec<String>>,
108+
/// Extra args to pass to the cargo command.
109+
pub extra_args: Vec<String>,
108110
/// Extra env vars to set when invoking the cargo command
109111
pub extra_env: FxHashMap<String, String>,
110112
pub invocation_strategy: InvocationStrategy,

crates/rust-analyzer/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,7 @@ impl Config {
11571157
InvocationLocation::Workspace => project_model::InvocationLocation::Workspace,
11581158
},
11591159
run_build_script_command: self.data.cargo_buildScripts_overrideCommand.clone(),
1160+
extra_args: self.data.check_extraArgs.clone(),
11601161
extra_env: self.data.cargo_extraEnv.clone(),
11611162
}
11621163
}

0 commit comments

Comments
 (0)