Unnamed repository; edit this file 'description' to name the repository.
minor: Record snippet config errors
Lukas Wirth 2022-04-28
parent 8b056fa · commit 075b189
-rw-r--r--crates/rust-analyzer/src/config.rs7
-rw-r--r--crates/rust-analyzer/src/global_state.rs2
-rw-r--r--crates/rust-analyzer/src/main_loop.rs2
3 files changed, 8 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index 833ee31eed..ad1f9c40e2 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"),
+ <serde_json::Error as serde::de::Error>::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 cfbd5f63bc..ebd6f35b42 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 96f4e2a50b..3870161826 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());
}
}
};