Unnamed repository; edit this file 'description' to name the repository.
LSP: Short-circuit documentColors request for no servers
This fixes a deadlock when starting Helix with very many files, like `hx runtime/queries/*/*.scm`. The tree-sitter query files don't have an active language server on my machine and yet we were spawning a tokio task to collect documentColors responses. We can skip that entirely. Further debugging is needed to figure out why this lead to a deadlock previously.
Michael Davis 8 months ago
parent 837627d · commit ba54b6a
-rw-r--r--helix-term/src/handlers/document_colors.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-term/src/handlers/document_colors.rs b/helix-term/src/handlers/document_colors.rs
index f46ef2ac..7813f317 100644
--- a/helix-term/src/handlers/document_colors.rs
+++ b/helix-term/src/handlers/document_colors.rs
@@ -81,6 +81,10 @@ fn request_document_colors(editor: &mut Editor, doc_id: DocumentId) {
})
.collect();
+ if futures.is_empty() {
+ return;
+ }
+
tokio::spawn(async move {
let mut all_colors = Vec::new();
loop {