mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 06:03:58 +00:00
add the allFeatures flag (true by default)
This commit is contained in:
parent
d38741f681
commit
c22660179c
3 changed files with 13 additions and 3 deletions
|
@ -24,7 +24,7 @@ pub use crate::conv::url_from_path_with_drive_lowercasing;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum FlycheckConfig {
|
pub enum FlycheckConfig {
|
||||||
CargoCommand { command: String, all_targets: bool, extra_args: Vec<String> },
|
CargoCommand { command: String, all_targets: bool, all_features: bool, extra_args: Vec<String> },
|
||||||
CustomCommand { command: String, args: Vec<String> },
|
CustomCommand { command: String, args: Vec<String> },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ impl FlycheckThread {
|
||||||
self.check_process = None;
|
self.check_process = None;
|
||||||
|
|
||||||
let mut cmd = match &self.config {
|
let mut cmd = match &self.config {
|
||||||
FlycheckConfig::CargoCommand { command, all_targets, extra_args } => {
|
FlycheckConfig::CargoCommand { command, all_targets, all_features, extra_args } => {
|
||||||
let mut cmd = Command::new(cargo_binary());
|
let mut cmd = Command::new(cargo_binary());
|
||||||
cmd.arg(command);
|
cmd.arg(command);
|
||||||
cmd.args(&["--workspace", "--message-format=json", "--manifest-path"]);
|
cmd.args(&["--workspace", "--message-format=json", "--manifest-path"]);
|
||||||
|
@ -223,6 +223,9 @@ impl FlycheckThread {
|
||||||
if *all_targets {
|
if *all_targets {
|
||||||
cmd.arg("--all-targets");
|
cmd.arg("--all-targets");
|
||||||
}
|
}
|
||||||
|
if *all_features {
|
||||||
|
cmd.arg("--all-features");
|
||||||
|
}
|
||||||
cmd.args(extra_args);
|
cmd.args(extra_args);
|
||||||
cmd
|
cmd
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,7 @@ impl Default for Config {
|
||||||
check: Some(FlycheckConfig::CargoCommand {
|
check: Some(FlycheckConfig::CargoCommand {
|
||||||
command: "check".to_string(),
|
command: "check".to_string(),
|
||||||
all_targets: true,
|
all_targets: true,
|
||||||
|
all_features: true,
|
||||||
extra_args: Vec::new(),
|
extra_args: Vec::new(),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
@ -173,12 +174,13 @@ impl Config {
|
||||||
}
|
}
|
||||||
// otherwise configure command customizations
|
// otherwise configure command customizations
|
||||||
_ => {
|
_ => {
|
||||||
if let Some(FlycheckConfig::CargoCommand { command, extra_args, all_targets })
|
if let Some(FlycheckConfig::CargoCommand { command, extra_args, all_targets, all_features })
|
||||||
= &mut self.check
|
= &mut self.check
|
||||||
{
|
{
|
||||||
set(value, "/checkOnSave/extraArgs", extra_args);
|
set(value, "/checkOnSave/extraArgs", extra_args);
|
||||||
set(value, "/checkOnSave/command", command);
|
set(value, "/checkOnSave/command", command);
|
||||||
set(value, "/checkOnSave/allTargets", all_targets);
|
set(value, "/checkOnSave/allTargets", all_targets);
|
||||||
|
set(value, "/checkOnSave/allFeatures", all_features);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -296,6 +296,11 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"markdownDescription": "Check all targets and tests (will be passed as `--all-targets`)"
|
"markdownDescription": "Check all targets and tests (will be passed as `--all-targets`)"
|
||||||
},
|
},
|
||||||
|
"rust-analyzer.checkOnSave.allFeatures": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"markdownDescription": "Check with all features (will be passed as `--all-features`)"
|
||||||
|
},
|
||||||
"rust-analyzer.inlayHints.typeHints": {
|
"rust-analyzer.inlayHints.typeHints": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true,
|
"default": true,
|
||||||
|
|
Loading…
Reference in a new issue