From 0b361e5b7cbf14173c70cefec540b37f917cc0e4 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 7 Jan 2025 20:34:24 -0700 Subject: [PATCH] Fix panic in request_multiple_lsp_locally (#22806) Release Notes: - Fix a panic after disconnecting from a remote project --- crates/project/src/lsp_store.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs index 891d77a3a4..90467ec33d 100644 --- a/crates/project/src/lsp_store.rs +++ b/crates/project/src/lsp_store.rs @@ -5592,13 +5592,13 @@ impl LspStore { ::Result: Send, ::Params: Send, { - debug_assert!(self.upstream_client().is_none()); + let Some(local) = self.as_local() else { + return Task::ready(Vec::new()); + }; let snapshot = buffer.read(cx).snapshot(); let scope = position.and_then(|position| snapshot.language_scope_at(position)); - let server_ids = self - .as_local() - .unwrap() + let server_ids = local .language_servers_for_buffer(buffer.read(cx), cx) .filter(|(adapter, _)| { scope