Fix race-condition in autosave (#39409)

This removes a long-standing thing we've done, which is send a `DidSave`
notification to the language server for the clean parts of a
multi-buffer. However, it seems like the intent of that notification is
to tell the language server to reload the file from disk.

As we didn't actually write those files to disk, it seems clearer to not
send this notification; and just remove this whole code-path.

Release Notes:

- Fixed a race where autosave in a multibuffer could cause unsaved
buffers to appear saved
This commit is contained in:
Conrad Irwin
2025-10-02 22:14:12 -06:00
committed by GitHub
parent dc6fad9659
commit e4f90b5da2
3 changed files with 117 additions and 23 deletions
+2 -3
View File
@@ -1312,9 +1312,8 @@ impl Buffer {
mtime: Option<MTime>,
cx: &mut Context<Self>,
) {
self.saved_version = version;
self.has_unsaved_edits
.set((self.saved_version().clone(), false));
self.saved_version = version.clone();
self.has_unsaved_edits.set((version, false));
self.has_conflict = false;
self.saved_mtime = mtime;
self.was_changed();