fix workspace/willRenameFiles buffer not editing

This commit is contained in:
Smit Barmase 2025-08-20 19:27:08 +05:30
parent 4c85a0dc71
commit b44ff09043
No known key found for this signature in database
3 changed files with 64 additions and 9 deletions

View file

@ -3555,6 +3555,7 @@ pub enum LspStoreEvent {
edits: Vec<(lsp::Range, Snippet)>,
most_recent_edit: clock::Lamport,
},
UnsavedBufferEdit(Entity<Buffer>),
}
#[derive(Clone, Debug, Serialize)]
@ -9210,15 +9211,24 @@ impl LspStore {
.log_err()
.flatten()?;
LocalLspStore::deserialize_workspace_edit(
this.upgrade()?,
edit,
false,
language_server.clone(),
cx,
)
.await
.ok();
if let Some(transaction) =
LocalLspStore::deserialize_workspace_edit(
this.upgrade()?,
edit,
false,
language_server.clone(),
cx,
)
.await
.ok()
{
for (buffer, _) in transaction.0 {
this.update(cx, |_, cx| {
cx.emit(LspStoreEvent::UnsavedBufferEdit(buffer));
})
.ok();
}
}
Some(())
}
});