mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Propagate cargo.target to checkOnSave
This commit is contained in:
parent
3432afcbd2
commit
a20b8d751b
2 changed files with 11 additions and 2 deletions
|
@ -22,6 +22,7 @@ pub use cargo_metadata::diagnostic::{
|
|||
pub enum FlycheckConfig {
|
||||
CargoCommand {
|
||||
command: String,
|
||||
target_tripple: Option<String>,
|
||||
all_targets: bool,
|
||||
all_features: bool,
|
||||
features: Vec<String>,
|
||||
|
@ -178,6 +179,7 @@ impl FlycheckActor {
|
|||
let mut cmd = match &self.config {
|
||||
FlycheckConfig::CargoCommand {
|
||||
command,
|
||||
target_tripple,
|
||||
all_targets,
|
||||
all_features,
|
||||
extra_args,
|
||||
|
@ -187,6 +189,10 @@ impl FlycheckActor {
|
|||
cmd.arg(command);
|
||||
cmd.args(&["--workspace", "--message-format=json", "--manifest-path"])
|
||||
.arg(self.workspace_root.join("Cargo.toml"));
|
||||
|
||||
if let Some(target) = target_tripple {
|
||||
cmd.args(&["--target", target.as_str()]);
|
||||
}
|
||||
if *all_targets {
|
||||
cmd.arg("--all-targets");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue