aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_flycheck/src/lib.rs4
-rw-r--r--crates/rust-analyzer/src/main_loop.rs13
-rw-r--r--crates/rust-analyzer/src/world.rs6
3 files changed, 12 insertions, 11 deletions
diff --git a/crates/ra_flycheck/src/lib.rs b/crates/ra_flycheck/src/lib.rs
index f6f9171ad..b6bb9da4b 100644
--- a/crates/ra_flycheck/src/lib.rs
+++ b/crates/ra_flycheck/src/lib.rs
@@ -24,7 +24,6 @@ pub use crate::conv::url_from_path_with_drive_lowercasing;
24 24
25#[derive(Clone, Debug)] 25#[derive(Clone, Debug)]
26pub struct CheckConfig { 26pub struct CheckConfig {
27 pub enable: bool,
28 pub args: Vec<String>, 27 pub args: Vec<String>,
29 pub command: String, 28 pub command: String,
30 pub all_targets: bool, 29 pub all_targets: bool,
@@ -216,9 +215,6 @@ impl CheckWatcherThread {
216 // First, clear and cancel the old thread 215 // First, clear and cancel the old thread
217 self.message_recv = never(); 216 self.message_recv = never();
218 self.check_process = None; 217 self.check_process = None;
219 if !self.options.enable {
220 return;
221 }
222 218
223 let mut args: Vec<String> = vec![ 219 let mut args: Vec<String> = vec![
224 self.options.command.clone(), 220 self.options.command.clone(),
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index bb33fb27d..16d7f1569 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -101,11 +101,14 @@ fn get_config(
101 chaining_hints: config.inlay_hints_chaining, 101 chaining_hints: config.inlay_hints_chaining,
102 max_length: config.inlay_hints_max_length, 102 max_length: config.inlay_hints_max_length,
103 }, 103 },
104 check: CheckConfig { 104 check: if config.cargo_watch_enable {
105 enable: config.cargo_watch_enable, 105 Some(CheckConfig {
106 args: config.cargo_watch_args.clone(), 106 args: config.cargo_watch_args.clone(),
107 command: config.cargo_watch_command.clone(), 107 command: config.cargo_watch_command.clone(),
108 all_targets: config.cargo_watch_all_targets, 108 all_targets: config.cargo_watch_all_targets,
109 })
110 } else {
111 None
109 }, 112 },
110 rustfmt_args: config.rustfmt_args.clone(), 113 rustfmt_args: config.rustfmt_args.clone(),
111 vscode_lldb: config.vscode_lldb, 114 vscode_lldb: config.vscode_lldb,
diff --git a/crates/rust-analyzer/src/world.rs b/crates/rust-analyzer/src/world.rs
index acb729bae..9a4e353fb 100644
--- a/crates/rust-analyzer/src/world.rs
+++ b/crates/rust-analyzer/src/world.rs
@@ -32,6 +32,8 @@ use ra_db::ExternSourceId;
32use rustc_hash::{FxHashMap, FxHashSet}; 32use rustc_hash::{FxHashMap, FxHashSet};
33 33
34fn create_watcher(workspaces: &[ProjectWorkspace], config: &Config) -> Option<CheckWatcher> { 34fn create_watcher(workspaces: &[ProjectWorkspace], config: &Config) -> Option<CheckWatcher> {
35 let check_config = config.check.as_ref()?;
36
35 // FIXME: Figure out the multi-workspace situation 37 // FIXME: Figure out the multi-workspace situation
36 workspaces 38 workspaces
37 .iter() 39 .iter()
@@ -41,7 +43,7 @@ fn create_watcher(workspaces: &[ProjectWorkspace], config: &Config) -> Option<Ch
41 }) 43 })
42 .map(|cargo| { 44 .map(|cargo| {
43 let cargo_project_root = cargo.workspace_root().to_path_buf(); 45 let cargo_project_root = cargo.workspace_root().to_path_buf();
44 Some(CheckWatcher::new(config.check.clone(), cargo_project_root)) 46 Some(CheckWatcher::new(check_config.clone(), cargo_project_root))
45 }) 47 })
46 .unwrap_or_else(|| { 48 .unwrap_or_else(|| {
47 log::warn!("Cargo check watching only supported for cargo workspaces, disabling"); 49 log::warn!("Cargo check watching only supported for cargo workspaces, disabling");
@@ -56,7 +58,7 @@ pub struct Config {
56 pub line_folding_only: bool, 58 pub line_folding_only: bool,
57 pub inlay_hints: InlayHintsConfig, 59 pub inlay_hints: InlayHintsConfig,
58 pub rustfmt_args: Vec<String>, 60 pub rustfmt_args: Vec<String>,
59 pub check: CheckConfig, 61 pub check: Option<CheckConfig>,
60 pub vscode_lldb: bool, 62 pub vscode_lldb: bool,
61 pub proc_macro_srv: Option<String>, 63 pub proc_macro_srv: Option<String>,
62} 64}