From 075b18942f029a4def59e793b76ab4620d6a4365 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 28 Apr 2022 15:17:44 +0200 Subject: [PATCH] minor: Record snippet config errors --- crates/rust-analyzer/src/config.rs | 7 ++++++- crates/rust-analyzer/src/global_state.rs | 2 +- crates/rust-analyzer/src/main_loop.rs | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 833ee31eed8..ad1f9c40e2b 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -584,7 +584,12 @@ impl Config { scope, ) { Some(snippet) => self.snippets.push(snippet), - None => tracing::info!("Invalid snippet {}", name), + None => errors.push(( + format!("snippet {name} is invalid"), + ::custom( + "snippet path is invalid or triggers are missing", + ), + )), } } diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index cfbd5f63bc1..ebd6f35b424 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs @@ -290,7 +290,7 @@ impl GlobalState { } let duration = start.elapsed(); - tracing::info!("handled {} - ({}) in {:0.2?}", method, response.id, duration); + tracing::debug!("handled {} - ({}) in {:0.2?}", method, response.id, duration); self.send(response.into()); } } diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 96f4e2a50b9..3870161826b 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -314,7 +314,7 @@ impl GlobalState { self.prime_caches_queue.op_completed(()); if cancelled { self.prime_caches_queue - .request_op("restart after cancelation".to_string()); + .request_op("restart after cancellation".to_string()); } } };