b7a4393
Redesign Worktree save API and make test_rescan_simple pass
Click to expand commit body
This commit does too much. The first goal was to change our approach to saving new buffers so that we don't need to construct a File for an entry that doesn't exist. Rather than doing that, we call `Worktree::save_buffer_as` with the buffer handle, the path, and the contents. This then saves the buffer and returns a handle to a `File` that references an entry that actually exists. I needed to do this so that we can store an entry id on `File`.
In the process, I noticed intermittent test failures on `test_rescan_simple`, so I made some changes required to fix those related to our reuse of existing ids. Our previous approach of removing a path when inserting a new entry was broken, because of the recursive nature of `remove_path`. Instead, I simply recycle the id of an existing worktree entry with the same path if one is present, then allow it to be replaced.
958345b
Assign a stable identity to Worktree entries
Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Antonio Scandurra
and
Nathan Sobo
created
65aa973
Restructure RPC state to also keep track of remote worktrees on guests
Antonio Scandurra
created
e72b4ae
Maintain active selections as editors are focused and blurred
Antonio Scandurra
created
0bc8663
Remove selection set when an editor is closed
Antonio Scandurra
created
e2b9ab5
Avoid double handle-read in File::buffer_updated
Max Brunsfeld
created
60ee97b
Always represent anchor as a versioned offset
Click to expand commit body
Remove the `Start` and `End` variants, and always
use the structure that was previously called `Middle`.
This makes Anchors simpler to serialize and deserialize.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Nathan Sobo
and
Max Brunsfeld
created
1364ba6
Allow async background work when polling worktree background snapshot
Click to expand commit body
This prepares us to perform a diff against the previous snapshot before installing a new worktree snapshot on the foreground thread.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
We only needed this when we relied on inodes for file identity, which we no longer attempt to do.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
For now this enum only contains a `Local` variant, but the next step is
to add a `Remote` variant that will be constructed when joining a remote
worktree.