Use entry_id on File instead of worktree::Diff to detect when buffers' files change

Rather than computing a diff after processing a batch of FSEvents, we instead detect renames as we're inserting entries. We store an entry_id on the File object that is owned by each buffer, and use this to detect when the path of the File has changed.

We now also manage all File-related state and event emission for Buffers in the LocalWorktree, since the logic will need to be totally different in the remote case.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Nathan Sobo
2021-06-29 18:19:38 -06:00
co-authored by Max Brunsfeld Antonio Scandurra
parent e80439daaa
commit 34963ac80d
7 changed files with 396 additions and 553 deletions
Generated
+19
View File
@@ -107,6 +107,15 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35c7a5669cb64f085739387e1308b74e6d44022464b7f1b63bbd4ceb6379ec31"
[[package]]
name = "archery"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a8da9bc4c4053ee067669762bcaeea6e241841295a2b6c948312dad6ef4cc02"
dependencies = [
"static_assertions",
]
[[package]]
name = "arrayref"
version = "0.3.6"
@@ -3027,6 +3036,15 @@ dependencies = [
"xmlparser",
]
[[package]]
name = "rpds"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "387f58b714cda2b5042ef9e91819445f60189900b618475186b11d7876f6adb4"
dependencies = [
"archery",
]
[[package]]
name = "rsa"
version = "0.4.0"
@@ -4330,6 +4348,7 @@ dependencies = [
"parking_lot",
"postage",
"rand 0.8.3",
"rpds",
"rsa",
"rust-embed",
"seahash",