aboutsummaryrefslogtreecommitdiff
path: root/crates/flycheck
diff options
context:
space:
mode:
Diffstat (limited to 'crates/flycheck')
-rw-r--r--crates/flycheck/Cargo.toml4
-rw-r--r--crates/flycheck/src/lib.rs21
2 files changed, 19 insertions, 6 deletions
diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml
index 1d19c7886..2a1a21b28 100644
--- a/crates/flycheck/Cargo.toml
+++ b/crates/flycheck/Cargo.toml
@@ -12,9 +12,9 @@ doctest = false
12[dependencies] 12[dependencies]
13crossbeam-channel = "0.5.0" 13crossbeam-channel = "0.5.0"
14log = "0.4.8" 14log = "0.4.8"
15cargo_metadata = "0.12.2" 15cargo_metadata = "0.13"
16serde_json = "1.0.48" 16serde_json = "1.0.48"
17jod-thread = "0.1.1" 17jod-thread = "0.1.1"
18 18
19toolchain = { path = "../toolchain", version = "0.0.0" } 19toolchain = { path = "../toolchain", version = "0.0.0" }
20stdx = { path = "../stdx", version = "0.0.0" } 20stdx = { path = "../stdx", version = "0.0.0" }
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs
index 4388e8c67..e2a59497a 100644
--- a/crates/flycheck/src/lib.rs
+++ b/crates/flycheck/src/lib.rs
@@ -76,7 +76,6 @@ impl FlycheckHandle {
76 } 76 }
77} 77}
78 78
79#[derive(Debug)]
80pub enum Message { 79pub enum Message {
81 /// Request adding a diagnostic with fixes included to a file 80 /// Request adding a diagnostic with fixes included to a file
82 AddDiagnostic { workspace_root: PathBuf, diagnostic: Diagnostic }, 81 AddDiagnostic { workspace_root: PathBuf, diagnostic: Diagnostic },
@@ -89,6 +88,21 @@ pub enum Message {
89 }, 88 },
90} 89}
91 90
91impl fmt::Debug for Message {
92 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
93 match self {
94 Message::AddDiagnostic { workspace_root, diagnostic } => f
95 .debug_struct("AddDiagnostic")
96 .field("workspace_root", workspace_root)
97 .field("diagnostic_code", &diagnostic.code.as_ref().map(|it| &it.code))
98 .finish(),
99 Message::Progress { id, progress } => {
100 f.debug_struct("Progress").field("id", id).field("progress", progress).finish()
101 }
102 }
103 }
104}
105
92#[derive(Debug)] 106#[derive(Debug)]
93pub enum Progress { 107pub enum Progress {
94 DidStart, 108 DidStart,
@@ -180,7 +194,7 @@ impl FlycheckActor {
180 cargo_metadata::Message::BuildScriptExecuted(_) 194 cargo_metadata::Message::BuildScriptExecuted(_)
181 | cargo_metadata::Message::BuildFinished(_) 195 | cargo_metadata::Message::BuildFinished(_)
182 | cargo_metadata::Message::TextLine(_) 196 | cargo_metadata::Message::TextLine(_)
183 | cargo_metadata::Message::Unknown => {} 197 | _ => {}
184 }, 198 },
185 } 199 }
186 } 200 }
@@ -315,8 +329,7 @@ impl CargoActor {
315 // Skip certain kinds of messages to only spend time on what's useful 329 // Skip certain kinds of messages to only spend time on what's useful
316 match &message { 330 match &message {
317 cargo_metadata::Message::CompilerArtifact(artifact) if artifact.fresh => (), 331 cargo_metadata::Message::CompilerArtifact(artifact) if artifact.fresh => (),
318 cargo_metadata::Message::BuildScriptExecuted(_) 332 cargo_metadata::Message::BuildScriptExecuted(_) => (),
319 | cargo_metadata::Message::Unknown => (),
320 _ => self.sender.send(message).unwrap(), 333 _ => self.sender.send(message).unwrap(),
321 } 334 }
322 } 335 }