Centralize all config

This commit is contained in:
Aleksey Kladov 2020-04-01 18:41:43 +02:00
parent 1e012eb991
commit a97e5eb85d
9 changed files with 153 additions and 330 deletions

View file

@ -22,12 +22,22 @@ use crate::conv::{map_rust_diagnostic_to_lsp, MappedRustDiagnostic};
pub use crate::conv::url_from_path_with_drive_lowercasing;
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum FlycheckConfig {
CargoCommand { command: String, all_targets: bool, extra_args: Vec<String> },
CustomCommand { command: String, args: Vec<String> },
}
impl Default for FlycheckConfig {
fn default() -> Self {
FlycheckConfig::CargoCommand {
command: "check".to_string(),
all_targets: true,
extra_args: Vec::new(),
}
}
}
/// Flycheck wraps the shared state and communication machinery used for
/// running `cargo check` (or other compatible command) and providing
/// diagnostics based on the output.