]> git.lizzy.rs Git - rust.git/blobdiff - crates/rust-analyzer/src/main_loop.rs
Add toggle to disable cache priming
[rust.git] / crates / rust-analyzer / src / main_loop.rs
index 8f00c6f6df35847114ba08483627cdeb4f7ae7f6..979b3b1522159679d2c1de1d81e5ca0bf2c9453e 100644 (file)
@@ -407,16 +407,7 @@ fn handle_event(&mut self, event: Event) -> Result<()> {
                             // the title, or the editor complains. Note that this is a user-facing string.
                             let title = if self.flycheck.len() == 1 {
                                 match self.config.flycheck() {
-                                    Some(flycheck::FlycheckConfig::CargoCommand {
-                                        command,
-                                        ..
-                                    }) => {
-                                        format!("cargo {}", command)
-                                    }
-                                    Some(flycheck::FlycheckConfig::CustomCommand {
-                                        command,
-                                        ..
-                                    }) => command,
+                                    Some(config) => format!("{}", config),
                                     None => "cargo check".to_string(),
                                 }
                             } else {
@@ -442,7 +433,9 @@ fn handle_event(&mut self, event: Event) -> Result<()> {
                 for flycheck in &self.flycheck {
                     flycheck.update();
                 }
-                self.prime_caches_queue.request_op();
+                if self.config.prefill_caches() {
+                    self.prime_caches_queue.request_op();
+                }
             }
 
             if !was_quiescent || state_changed {