From 18ec1ed72e757dd539cadc80309f54b8ca33dd14 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 1 Jul 2020 14:49:13 +0200 Subject: Log flycheck command --- crates/flycheck/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/flycheck') diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 1023d3040..844b093d4 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -132,6 +132,7 @@ impl FlycheckActor { self.cancel_check_process(); let mut command = self.check_command(); + log::info!("restart flycheck {:?}", command); command.stdout(Stdio::piped()).stderr(Stdio::null()).stdin(Stdio::null()); if let Ok(child) = command.spawn().map(JodChild) { self.cargo_handle = Some(CargoHandle::spawn(child)); -- cgit v1.2.3 From b3985190114233861132b0f479731f00380e1342 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 9 Jul 2020 15:34:37 +0200 Subject: Cleanup diagnostic conversion code --- crates/flycheck/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/flycheck') diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 844b093d4..6804d9bda 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -14,7 +14,8 @@ use std::{ use crossbeam_channel::{never, select, unbounded, Receiver, Sender}; pub use cargo_metadata::diagnostic::{ - Applicability, Diagnostic, DiagnosticLevel, DiagnosticSpan, DiagnosticSpanMacroExpansion, + Applicability, Diagnostic, DiagnosticCode, DiagnosticLevel, DiagnosticSpan, + DiagnosticSpanMacroExpansion, }; #[derive(Clone, Debug, PartialEq, Eq)] -- cgit v1.2.3 From 6f423466d181130848c229e2684c6dd18f8a5e9d Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 14 Jul 2020 10:57:26 +0900 Subject: Add a license field to all the crates --- crates/flycheck/Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/flycheck') diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml index dc26b8ce7..bea485694 100644 --- a/crates/flycheck/Cargo.toml +++ b/crates/flycheck/Cargo.toml @@ -3,6 +3,7 @@ edition = "2018" name = "flycheck" version = "0.1.0" authors = ["rust-analyzer developers"] +license = "MIT OR Apache-2.0" [lib] doctest = false -- cgit v1.2.3 From a20b8d751bb59becb19c9edbb5e3f3ffe31bbcf3 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 21 Jul 2020 10:30:54 +0200 Subject: Propagate cargo.target to checkOnSave --- crates/flycheck/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/flycheck') diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 6804d9bda..6e06adaa5 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -22,6 +22,7 @@ pub use cargo_metadata::diagnostic::{ pub enum FlycheckConfig { CargoCommand { command: String, + target_tripple: Option, all_targets: bool, all_features: bool, features: Vec, @@ -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"); } -- cgit v1.2.3 From 8f3fdf33155449f2d6d35f3f05099a59b259bd42 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 21 Jul 2020 10:50:24 +0200 Subject: Typo --- crates/flycheck/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/flycheck') diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 6e06adaa5..ad376ad18 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -22,7 +22,7 @@ pub use cargo_metadata::diagnostic::{ pub enum FlycheckConfig { CargoCommand { command: String, - target_tripple: Option, + target_triple: Option, all_targets: bool, all_features: bool, features: Vec, @@ -179,7 +179,7 @@ impl FlycheckActor { let mut cmd = match &self.config { FlycheckConfig::CargoCommand { command, - target_tripple, + target_triple, all_targets, all_features, extra_args, @@ -190,7 +190,7 @@ impl FlycheckActor { cmd.args(&["--workspace", "--message-format=json", "--manifest-path"]) .arg(self.workspace_root.join("Cargo.toml")); - if let Some(target) = target_tripple { + if let Some(target) = target_triple { cmd.args(&["--target", target.as_str()]); } if *all_targets { -- cgit v1.2.3 From e51d1ddf5bb0b4aac9881a56664d26b436408255 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Wed, 29 Jul 2020 17:06:56 -0400 Subject: cargo_metadata 0.11.1 and cargo update --- crates/flycheck/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/flycheck') diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml index bea485694..ff8a1e568 100644 --- a/crates/flycheck/Cargo.toml +++ b/crates/flycheck/Cargo.toml @@ -11,7 +11,7 @@ doctest = false [dependencies] crossbeam-channel = "0.4.0" log = "0.4.8" -cargo_metadata = "0.10.0" +cargo_metadata = "0.11.1" serde_json = "1.0.48" jod-thread = "0.1.1" ra_toolchain = { path = "../ra_toolchain" } -- cgit v1.2.3 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') 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