Commit Graph
365 Commits
Author SHA1 Message Date
Antonio Scandurra 2ecdc65f38 WIP 2021-07-13 16:36:35 +02:00
Max BrunsfeldandNathan Sobo 2a90347b82 Store an Fs on Workspace, pass it to each Worktree
Push test-only worktree behavior down into the Fs,
via a `watch` method which provides fs events.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-12 17:26:14 -07:00
Antonio Scandurra 34abda3a04 🔥 Remove stray logging statements 2021-07-12 17:52:16 +02:00
Max Brunsfeld eeebc761b6 Restructure Peer to handle connections' messages in order 2021-07-09 16:27:34 -07:00
Antonio Scandurra d82411e539 Relay the saved mtime when saving a buffer 2021-07-08 15:49:41 +02:00
Antonio Scandurra 2a779d3529 Rename {Add,Remove}Guest to {Add,Remove}Peer 2021-07-05 10:24:39 +02:00
Antonio Scandurra 569a4a1e2d WIP: Save remote buffers 2021-07-02 17:02:17 +02:00
Antonio Scandurra 7ae1d9e997 Send also the currently active selection sets when serializing a buffer 2021-07-02 11:29:36 +02:00
Antonio Scandurra da7bd8439b Report SelectionSet deletion operations correctly 2021-07-01 12:54:16 +02:00
Antonio Scandurra c881c7f30f Start on rendering remote selections 2021-07-01 11:21:43 +02:00
Antonio Scandurra 7704291432 Maintain a set of peers as they join and leave the worktree 2021-06-30 13:22:22 +02:00
Nathan Sobo bbf803d7dc Store a reference to the LangageRegistry on the Worktree 2021-06-29 20:07:37 -06:00
34963ac80d 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>
2021-06-29 18:19:38 -06:00
Antonio Scandurra e80439daaa Merge branch 'main' into rpc 2021-06-29 10:25:42 +02:00
Nathan Sobo b7a4393f29 Redesign Worktree save API and make test_rescan_simple pass
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.
2021-06-28 19:05:38 -06:00
Antonio Scandurra 65aa9733d7 Restructure RPC state to also keep track of remote worktrees on guests 2021-06-28 15:35:36 +02:00
Antonio Scandurra e72b4ae03d Maintain active selections as editors are focused and blurred 2021-06-28 12:37:58 +02:00
Max Brunsfeld e2b9ab500f Avoid double handle-read in File::buffer_updated 2021-06-25 17:21:42 -07:00
Max Brunsfeld 60ee97be24 Always represent anchor as a versioned offset
Remove the `Start` and `End` variants, and always
use the structure that was previously called `Middle`.
This makes Anchors simpler to serialize and deserialize.
2021-06-25 17:02:48 -07:00
Max BrunsfeldandNathan Sobo b9952bad8b Send and receive buffer operations
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-06-25 16:26:35 -07:00
Max Brunsfeld 04c80578bc Start work on sending buffer operations 2021-06-25 13:46:36 -07:00
Nathan SoboandMax Brunsfeld 7ee0862b99 Notify host when guests close buffers
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-25 11:33:40 -07:00
Max BrunsfeldandNathan Sobo 54c4b31249 Fix last usage of App::test_async in one test
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-06-23 18:05:03 -07:00
Antonio Scandurra 02321af08a Respond to proto::OpenBuffer requests 2021-06-23 16:20:02 +02:00
Nathan SoboandMax Brunsfeld c5e08b6548 Eagerly update worktree entries when saving
Don't use ModelHandles for storing Files.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-22 17:53:35 -07:00
Max Brunsfeld dc8e216fcb WIP - Maintain a set of open buffers on a LocalWorktree 2021-06-22 12:29:58 -07:00
Nathan SoboandMax Brunsfeld a364839e93 Replace FileHandle with File entity that subscribes to Worktree update events
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-21 20:40:40 -06:00
Antonio Scandurra f4d6fbe14f Issue only one OpenFile and CloseFile request per handle 2021-06-21 12:04:38 +02:00
Max Brunsfeld a2a6d67e1e Start work on implementing ::file on remote WorktreeHandles 2021-06-18 13:32:38 -07:00
Antonio Scandurra 79cac1340e Replace Worktree with an enum
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.
2021-06-18 12:07:57 +02:00
Antonio Scandurra 742241a903 Rename Cursor::{start,end} to Cursor::{sum_start,sum_end} 2021-06-10 14:06:27 +02:00
Antonio Scandurra dc2805bb14 Add Cursor::seek_end and audit the codebase to use seek_start more 2021-06-10 14:05:56 +02:00
Antonio Scandurra f294bfdbd9 Introduce Cursor::seek_start to compute VersionedOffset once 2021-06-10 13:42:43 +02:00
Antonio Scandurra 71f50ce361 Restore random edits in test to 5 2021-06-09 20:51:14 +02:00
Antonio Scandurra 072a57580d Delete leftover test 2021-06-08 11:55:17 +02:00
Antonio Scandurra 467e1a44d3 Restore History::group 2021-06-08 11:53:32 +02:00
Antonio ScandurraandNathan Sobo 98ea7b3d64 Batch edits contained in undo operations
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-06-08 11:53:23 +02:00
Antonio Scandurra 2bf6fe7735 Group only transactions that are temporally contiguous 2021-06-05 12:22:59 +02:00
Antonio Scandurra 1fe55d041f Speed up undoing multi-cursor changes 2021-06-05 12:03:45 +02:00
Antonio Scandurra 5d1afaf484 Reduce Fragment size by not storing ReplicaId twice 2021-06-04 18:03:44 +02:00
Antonio Scandurra 8f8c6c8add Delete unused Insertion struct 2021-06-04 16:42:32 +02:00
Antonio Scandurra 125be2f07a Save an allocation when editing locally 2021-06-04 13:42:37 +02:00
Antonio Scandurra e071d40058 Use a single Bias enum everywhere 2021-06-04 13:39:57 +02:00
Antonio Scandurra 3b9d760f2b Add blanket implementation for (D1, D2) when they impl Dimension 2021-06-04 12:36:38 +02:00
Antonio Scandurra f016400ddc Remove FullOffset 2021-06-04 12:34:35 +02:00
Antonio Scandurra eaf09463be Remove commented out code 2021-06-04 11:10:53 +02:00
Antonio Scandurra ec07b8ca1d Change fragment's visibility only if it was visible at a version 2021-06-04 11:07:52 +02:00
Antonio Scandurra 9bf3038857 Coalesce contiguous ranges when editing locally 2021-06-04 10:08:52 +02:00
Max Brunsfeld 23c4621b36 Reenable undo/redo in randomized concurrent edit test
Currently this fails
2021-06-03 17:41:51 -07:00
Max Brunsfeld de9626ac12 Get random concurrent edits test passing, except for undo 2021-06-03 17:38:30 -07:00