Fill capabilities on project (re)join (#35892)
Follow-up of https://github.com/zed-industries/zed/pull/35682 Release Notes: - N/A Co-authored-by: Smit Barmase <smit@zed.dev>
This commit is contained in:
parent
024a5bbcd0
commit
e0fc32009f
2 changed files with 17 additions and 4 deletions
|
@ -7768,12 +7768,19 @@ impl LspStore {
|
|||
pub(crate) fn set_language_server_statuses_from_proto(
|
||||
&mut self,
|
||||
language_servers: Vec<proto::LanguageServer>,
|
||||
server_capabilities: Vec<String>,
|
||||
) {
|
||||
self.language_server_statuses = language_servers
|
||||
.into_iter()
|
||||
.map(|server| {
|
||||
.zip(server_capabilities)
|
||||
.map(|(server, server_capabilities)| {
|
||||
let server_id = LanguageServerId(server.id as usize);
|
||||
if let Ok(server_capabilities) = serde_json::from_str(&server_capabilities) {
|
||||
self.lsp_server_capabilities
|
||||
.insert(server_id, server_capabilities);
|
||||
}
|
||||
(
|
||||
LanguageServerId(server.id as usize),
|
||||
server_id,
|
||||
LanguageServerStatus {
|
||||
name: LanguageServerName::from_proto(server.name),
|
||||
pending_work: Default::default(),
|
||||
|
|
|
@ -1487,7 +1487,10 @@ impl Project {
|
|||
fs.clone(),
|
||||
cx,
|
||||
);
|
||||
lsp_store.set_language_server_statuses_from_proto(response.payload.language_servers);
|
||||
lsp_store.set_language_server_statuses_from_proto(
|
||||
response.payload.language_servers,
|
||||
response.payload.language_server_capabilities,
|
||||
);
|
||||
lsp_store
|
||||
})?;
|
||||
|
||||
|
@ -2318,7 +2321,10 @@ impl Project {
|
|||
self.set_worktrees_from_proto(message.worktrees, cx)?;
|
||||
self.set_collaborators_from_proto(message.collaborators, cx)?;
|
||||
self.lsp_store.update(cx, |lsp_store, _| {
|
||||
lsp_store.set_language_server_statuses_from_proto(message.language_servers)
|
||||
lsp_store.set_language_server_statuses_from_proto(
|
||||
message.language_servers,
|
||||
message.language_server_capabilities,
|
||||
)
|
||||
});
|
||||
self.enqueue_buffer_ordered_message(BufferOrderedMessage::Resync)
|
||||
.unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue