Store pulled diagnostics' result_ids more persistently (#32403)

Follow-up of https://github.com/zed-industries/zed/pull/19230

`BufferId` can change between file reopens: e.g. open the buffer, close
it, go back in history to reopen it — the 2nd one will have a different
`BufferId`, but the same `result_ids` semantically.

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-06-09 20:05:33 +03:00 committed by GitHub
parent de16f2bbe6
commit fa54fa80d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 19 deletions

View file

@ -4050,7 +4050,7 @@ impl LspCommand for GetDocumentDiagnostics {
let buffer_id = buffer.update(&mut cx, |buffer, _| buffer.remote_id())?;
Ok(Self {
previous_result_id: lsp_store
.update(&mut cx, |lsp_store, _| lsp_store.result_id(buffer_id))?,
.update(&mut cx, |lsp_store, cx| lsp_store.result_id(buffer_id, cx))?,
})
}