Commit Graph
92 Commits
Author SHA1 Message Date
Max BrunsfeldandNathan Sobo 8e5c709057 Block for up to 1ms when reparsing
This way, we'll avoid rendering two frames on edits that lead to fast reparses.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-09-06 12:50:38 -07:00
Max BrunsfeldandNathan Sobo 11b8577d1b Update FoldMap snapshot versions when only the parse tree changes
even if the buffer's text has not changed

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-09-06 11:57:55 -07:00
Max BrunsfeldandNathan Sobo 6df80d94ad Allow subscription/notification to be cancelled by dropping the returned Subscription
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-23 15:54:24 -07:00
Max Brunsfeld 5ecedd894d Add ChannelList to AppState 2021-08-23 15:03:45 -07:00
Max BrunsfeldandNathan Sobo 43bb38206f Add generic subscribe and observe methods to contexts
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-23 15:03:12 -07:00
Nathan Sobo c3dda14490 WIP: Move sum_tree module into gpui so we can use it in List 2021-08-20 16:18:39 -06:00
Max BrunsfeldandNathan Sobo 802f1f4e78 Get new theme structure working
* Fix precedence of extends directives
* Always group color with font properties for text theming

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-04 14:07:19 -07:00
Nathan SoboandAntonio Scandurra a1991a7458 Report the end of the current row rather than the start of the next
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
c1a9a20ac9 Setup randomized test harness in gpui::test
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-07-30 09:50:28 -07:00
Antonio ScandurraandNathan Sobo 61f45800d3 Optimize Buffer::edits_since when the version hasn't changed
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-23 16:31:00 +02:00
Antonio Scandurra 80f13dd737 WIP 2021-07-22 18:31:01 +02:00
Max BrunsfeldandNathan Sobo f9e13f3429 Start work on WrapMap::chunks_at
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 16:23:56 -07:00
Antonio Scandurra 9e448e694d Add fold_map::Snapshot::text_summary_for_range 2021-07-19 12:25:27 +02:00
Antonio Scandurra 831b620e51 Make writing/reading FoldMap explicit so that we can retrieve edits 2021-07-16 13:49:38 +02:00
Nathan SoboandMax Brunsfeld 2bde54971e Move all FoldMap query methods to FoldMapSnapshot
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-15 11:36:24 -06:00
Nathan Sobo 09afba9251 Introduce buffer::Content<'a> struct to share logic with buffer::Snapshot
We want to move a bunch of methods on FoldMap to fold_map::Snapshot. This captures a buffer snapshot, and we'll need a bunch of methods that currently are on Buffer to also be implemented on buffer::Snapshot. This Content reference struct will be a good zero-cost place to store that logic.
2021-07-15 09:50:50 -06:00
Antonio Scandurra be954872d0 Calculate an old_lines range in Edits iterator 2021-07-15 10:11:24 +02:00
Max Brunsfeld 7260442d42 Move the fs module out of worktree 2021-07-13 15:40:11 -07:00
391ad489ff Rename zed-rpc to zrpc
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-07-13 18:22:00 +02:00
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