diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-25 07:08:30 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-25 07:08:30 +0100 |
commit | 659b16981a19b3b47f63e6cd4b7f668775e8e9a4 (patch) | |
tree | 0ff97656e30c9b1fe3c4bb96b0171f33890c11ee /crates/ra_flycheck/src/lib.rs | |
parent | 78e94e4570f09c8cbe1f8c6802df9b112ca37f08 (diff) | |
parent | 874a5f80c74851aa142a196be49b73f55bd1c619 (diff) |
Merge #5046
5046: Fix progress reporting for flycheck r=matklad a=matklad
bors r+
Co-authored-by: veetaha <[email protected]>
Co-authored-by: Veetaha <[email protected]>
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_flycheck/src/lib.rs')
-rw-r--r-- | crates/ra_flycheck/src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_flycheck/src/lib.rs b/crates/ra_flycheck/src/lib.rs index 6c4170529..0e2ee8698 100644 --- a/crates/ra_flycheck/src/lib.rs +++ b/crates/ra_flycheck/src/lib.rs | |||
@@ -3,6 +3,7 @@ | |||
3 | //! LSP diagnostics based on the output of the command. | 3 | //! LSP diagnostics based on the output of the command. |
4 | 4 | ||
5 | use std::{ | 5 | use std::{ |
6 | fmt, | ||
6 | io::{self, BufReader}, | 7 | io::{self, BufReader}, |
7 | path::PathBuf, | 8 | path::PathBuf, |
8 | process::{Command, Stdio}, | 9 | process::{Command, Stdio}, |
@@ -31,6 +32,17 @@ pub enum FlycheckConfig { | |||
31 | }, | 32 | }, |
32 | } | 33 | } |
33 | 34 | ||
35 | impl fmt::Display for FlycheckConfig { | ||
36 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
37 | match self { | ||
38 | FlycheckConfig::CargoCommand { command, .. } => write!(f, "cargo {}", command), | ||
39 | FlycheckConfig::CustomCommand { command, args } => { | ||
40 | write!(f, "{} {}", command, args.join(" ")) | ||
41 | } | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | |||
34 | /// Flycheck wraps the shared state and communication machinery used for | 46 | /// Flycheck wraps the shared state and communication machinery used for |
35 | /// running `cargo check` (or other compatible command) and providing | 47 | /// running `cargo check` (or other compatible command) and providing |
36 | /// diagnostics based on the output. | 48 | /// diagnostics based on the output. |