Revert "language: Remove buffer fingerprinting (#9007)"
This reverts commit 6f2f61c9b1
.
This commit is contained in:
parent
35e3935e8f
commit
caed275fbf
12 changed files with 122 additions and 22 deletions
|
@ -31,8 +31,12 @@ use gpui::{
|
|||
use ignore::IgnoreStack;
|
||||
use itertools::Itertools;
|
||||
use language::{
|
||||
proto::{deserialize_version, serialize_line_ending, serialize_version},
|
||||
Buffer, Capability, DiagnosticEntry, File as _, LineEnding, PointUtf16, Rope, Unclipped,
|
||||
proto::{
|
||||
deserialize_fingerprint, deserialize_version, serialize_fingerprint, serialize_line_ending,
|
||||
serialize_version,
|
||||
},
|
||||
Buffer, Capability, DiagnosticEntry, File as _, LineEnding, PointUtf16, Rope, RopeFingerprint,
|
||||
Unclipped,
|
||||
};
|
||||
use lsp::{DiagnosticSeverity, LanguageServerId};
|
||||
use parking_lot::Mutex;
|
||||
|
@ -1147,6 +1151,7 @@ impl LocalWorktree {
|
|||
}
|
||||
|
||||
let text = buffer.as_rope().clone();
|
||||
let fingerprint = text.fingerprint();
|
||||
let version = buffer.version();
|
||||
let save = self.write_file(path.as_ref(), text, buffer.line_ending(), cx);
|
||||
let fs = Arc::clone(&self.fs);
|
||||
|
@ -1209,11 +1214,12 @@ impl LocalWorktree {
|
|||
buffer_id,
|
||||
version: serialize_version(&version),
|
||||
mtime: mtime.map(|time| time.into()),
|
||||
fingerprint: serialize_fingerprint(fingerprint),
|
||||
})?;
|
||||
}
|
||||
|
||||
buffer_handle.update(&mut cx, |buffer, cx| {
|
||||
buffer.did_save(version.clone(), mtime, cx);
|
||||
buffer.did_save(version.clone(), fingerprint, mtime, cx);
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
|
@ -1614,10 +1620,11 @@ impl RemoteWorktree {
|
|||
})
|
||||
.await?;
|
||||
let version = deserialize_version(&response.version);
|
||||
let fingerprint = deserialize_fingerprint(&response.fingerprint)?;
|
||||
let mtime = response.mtime.map(|mtime| mtime.into());
|
||||
|
||||
buffer_handle.update(&mut cx, |buffer, cx| {
|
||||
buffer.did_save(version.clone(), mtime, cx);
|
||||
buffer.did_save(version.clone(), fingerprint, mtime, cx);
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
|
@ -2999,6 +3006,7 @@ impl language::LocalFile for File {
|
|||
&self,
|
||||
buffer_id: BufferId,
|
||||
version: &clock::Global,
|
||||
fingerprint: RopeFingerprint,
|
||||
line_ending: LineEnding,
|
||||
mtime: Option<SystemTime>,
|
||||
cx: &mut AppContext,
|
||||
|
@ -3012,6 +3020,7 @@ impl language::LocalFile for File {
|
|||
buffer_id: buffer_id.into(),
|
||||
version: serialize_version(version),
|
||||
mtime: mtime.map(|time| time.into()),
|
||||
fingerprint: serialize_fingerprint(fingerprint),
|
||||
line_ending: serialize_line_ending(line_ending) as i32,
|
||||
})
|
||||
.log_err();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue