Skip to content

Commit

Permalink
Fix panic in request_multiple_lsp_locally (#22806)
Browse files Browse the repository at this point in the history
Release Notes:

- Fix a panic after disconnecting from a remote project
  • Loading branch information
ConradIrwin authored Jan 8, 2025
1 parent 222b045 commit 0b361e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/project/src/lsp_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5592,13 +5592,13 @@ impl LspStore {
<R::LspRequest as lsp::request::Request>::Result: Send,
<R::LspRequest as lsp::request::Request>::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
Expand Down

0 comments on commit 0b361e5

Please sign in to comment.