From 8d9f8ac2739e7d02bcbc69e933682c2ef305f987 Mon Sep 17 00:00:00 2001 From: Clemens Wasser Date: Thu, 30 Jul 2020 16:04:01 +0200 Subject: flycheck: Added checkOnSave.noDefaultFeatures This commit adds the option `rust-analyzer.checkOnSave.noDefaultFeatures` and fixes #5550. --- crates/flycheck/src/lib.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crates/flycheck/src/lib.rs') diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index ad376ad18..7c38f5ef9 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -24,6 +24,7 @@ pub enum FlycheckConfig { command: String, target_triple: Option, all_targets: bool, + no_default_features: bool, all_features: bool, features: Vec, extra_args: Vec, @@ -180,6 +181,7 @@ impl FlycheckActor { FlycheckConfig::CargoCommand { command, target_triple, + no_default_features, all_targets, all_features, extra_args, @@ -198,9 +200,14 @@ impl FlycheckActor { } if *all_features { cmd.arg("--all-features"); - } else if !features.is_empty() { - cmd.arg("--features"); - cmd.arg(features.join(" ")); + } else { + if *no_default_features { + cmd.arg("--no-default-features"); + } + if !features.is_empty() { + cmd.arg("--features"); + cmd.arg(features.join(" ")); + } } cmd.args(extra_args); cmd -- cgit v1.2.3