Use a proper snapshot version when resolving for utf16 points (#32815)

Release Notes:

- Fixed a panic when merging pull and (newer) push diagnostics

Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
Kirill Bulatov 2025-06-17 01:57:30 +03:00 committed by GitHub
parent 69e84c0c48
commit 6d96f8be8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6680,11 +6680,7 @@ impl LspStore {
};
if let Some(buffer_handle) = self.buffer_store.read(cx).get_by_path(&project_path, cx) {
let snapshot = self
.as_local_mut()
.unwrap()
.buffer_snapshot_for_lsp_version(&buffer_handle, server_id, version, cx)?;
let snapshot = buffer_handle.read(cx).snapshot();
let buffer = buffer_handle.read(cx);
let reused_diagnostics = buffer
.get_diagnostics(server_id)