aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_flycheck/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_flycheck/src/lib.rs')
-rw-r--r--crates/ra_flycheck/src/lib.rs12
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
5use std::{ 5use 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
35impl 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.