diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-28 14:08:54 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-28 14:08:54 +0000 |
commit | 4a88d9349945bcf1257245e985c8a3387485d149 (patch) | |
tree | 24c652859d30afdf198883e7f0cbe15f609682b6 /crates/flycheck/src | |
parent | a3f5e7db557436a4e22cf4bcc66eaa5bc3661978 (diff) | |
parent | 4b59c3a538f27238b0466898f1b4ac69d1f9e778 (diff) |
Merge #7474
7474: Make logger-based debugging more pleasant r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/flycheck/src')
-rw-r--r-- | crates/flycheck/src/lib.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 4388e8c67..e04208006 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)] | ||
80 | pub enum Message { | 79 | pub 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 | ||
91 | impl 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)] |
93 | pub enum Progress { | 107 | pub enum Progress { |
94 | DidStart, | 108 | DidStart, |