It's okay for our domain objects to model remote state. We should minimize what we need to store in the rpc::ClientState struct.
Nathan Sobo
created
bbf803d
Store a reference to the LangageRegistry on the Worktree
Nathan Sobo
created
34963ac
Use entry_id on File instead of worktree::Diff to detect when buffers' files change
Click to expand commit body
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>
Nathan Sobo
,
Max Brunsfeld
, and
Antonio Scandurra
created
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.