Commit Graph
422 Commits
Author SHA1 Message Date
Max Brunsfeld 743638537e Emit the WorktreeRemoved event when removing a worktree from a project 2022-05-27 10:49:10 -07:00
Max Brunsfeld 4e308c6fa7 Emit an event when adding a worktree to a project 2022-05-27 10:48:47 -07:00
Antonio Scandurra ce06f5ef2a Pretty-print JSON of server snapshot 2022-05-26 09:34:39 +02:00
Antonio Scandurra 3f74c6e743 Bump chunk size to 256 2022-05-24 09:54:53 +02:00
Antonio Scandurra 4f5a32e850 Fix logic error when streaming ignored entries
We were calling `next` twice, which led us to skip every other entry.
This commit also enhances the `test_share_project` integration test
to exercise this new streaming logic.
2022-05-24 09:03:05 +02:00
Antonio ScandurraandNathan Sobo 07961a9dcd WIP: log received updated_entries on remote worktree
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-23 19:39:24 +02:00
Antonio ScandurraandNathan Sobo a16c11af5b Correctly assign ignored status in refresh_entry
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-23 19:19:13 +02:00
Antonio Scandurra 3acad1f75c WIP: stream ignored entries 2022-05-23 16:38:16 +02:00
Antonio Scandurra c96ff01fbb Fix worktree::Snapshot::entries(true) always being empty 2022-05-23 15:38:20 +02:00
Max Brunsfeld e6011794ca Remove AppState from workspace actions
This allows those actions to be bound to keystrokes in the keymap.
Also, remove the WorkspaceParams struct, simplify how Workspaces are
constructed.
2022-05-19 14:37:26 -07:00
Antonio Scandurra e062c97b68 WIP: accept to join requests if user is already participating
There's a panic caused by `Store::check_invariants` that we still
need to figure out.
2022-05-17 13:21:20 +02:00
Nathan Sobo 6be7161888 Cancel join requests when the requester closes the window 2022-05-16 20:29:36 -06:00
Antonio ScandurraandNathan Sobo 1738d4dbbe Show the reason why a join request was declined
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-16 19:57:50 +02:00
Antonio Scandurra 06e988c231 Poll snapshot after refreshing entry 2022-05-16 11:50:21 +02:00
Antonio Scandurra 121611cbc7 Grab share state after retrieving metadata when refreshing entry 2022-05-16 11:46:49 +02:00
Max Brunsfeld 5d563459e7 WIP - update worktree's scan_id when mutating it in the foreground 2022-05-13 17:03:48 -07:00
Antonio ScandurraandNathan Sobo b8383deda2 Fix randomized test failure caused by unsharing while guest was joining
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-13 17:39:13 +02:00
Antonio ScandurraandNathan Sobo b3fc910632 Make Project::share and Project::unshare private
This is still in-progress because randomized tests are failing.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-13 17:17:20 +02:00
Max BrunsfeldandNathan Sobo 8d00fab9b1 Start work on requesting to join projects
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-12 17:53:11 -07:00
Max BrunsfeldandNathan Sobo c9d9e90b95 Avoid panic when language server is dropped before being initialized in tests
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-09 18:05:10 -07:00
Max Brunsfeld 0684665af5 Remove remaining code associated with .zed.toml files 2022-05-09 16:31:30 -07:00
Max Brunsfeld a56faf9bec Pick files directly from the Fs in simulate_host
Previously, the list of all existing files was maintained separately, but
it was not updated when a guest created a file.
2022-05-09 15:39:45 -07:00
Max BrunsfeldandNathan Sobo a7359d0c77 Allow fuzzy-search for potential contacts in the contacts panel
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-05 14:14:44 -07:00
Antonio Scandurra eed6ef2380 Wait for remote worktree to catch up with host before mutating entries
This ensures that entries don't randomly re-appear on remote worktrees
due to observing an update too late. In fact, it ensures that the remote
worktree has the same starting state of the host before preemptively applying
the fs operation locally.
2022-05-05 13:47:53 +02:00
Antonio Scandurra 16bd397e57 Fix bugs in FakeFs::{remove_dir,rename} 2022-05-05 09:02:31 +02:00
Max Brunsfeld 51bf66e754 Allow deleting entries from the project panel 2022-05-04 18:00:23 -07:00
Max Brunsfeld c689bc03ba Allow guests to create directories 2022-05-04 16:52:46 -07:00
Max Brunsfeld 39f264e9fd Allow creating directories from the project panel 2022-05-04 16:47:11 -07:00
Max BrunsfeldandNathan Sobo 8c901cb6a1 Prevent eager snapshot mutations from being clobbered by background updates
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-04 15:10:39 -07:00
d86f385278 Allow guests to rename stuff
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-04 10:28:44 -07:00
Nathan SoboandAntonio Scandurra 6ad2213b7f Rename entries via the project to prepare for guest support
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-05-04 10:28:44 -07:00
Max BrunsfeldandNathan Sobo 8b64406938 Allow guests to create files from the project panel
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-04 10:28:44 -07:00
Max Brunsfeld 5fdaa2da96 Update snapshot atomically when processing FS events 2022-05-04 10:28:44 -07:00
Max Brunsfeld 133cb544b2 Select new files in the project panel after creating them 2022-05-04 10:28:44 -07:00
Max Brunsfeld c2a3ef5677 Rename entry atomically in LocalWorktree::rename 2022-05-04 10:28:44 -07:00
Max BrunsfeldandAntonio Scandurra c98d740d34 Improve the appearance of project panel filename editor
* Always layout single-line editors with a fixed height
* Preserve directory chevron when editing folder names
* Allow theming the filename editor

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-05-04 10:28:44 -07:00
Max Brunsfeld dc0937e936 Implement Rename command in project panel 2022-05-04 10:28:09 -07:00
Max Brunsfeld dbfbd352f0 Implement basic AddFile command in project panel 2022-05-04 10:28:09 -07:00
Max Brunsfeld a95bc19817 Abstract more local project setup inside Project::test helper 2022-05-04 10:28:09 -07:00
Keith Simmons 94b6f4beb5 Merge pull request #929 from zed-industries/non-uniform-batched-edits
Allow batched edits where each range is associated with different insertion text
2022-04-29 16:14:38 -07:00
Keith Simmons 47d4f42467 Consolidate edit and edit_batched functions 2022-04-28 16:52:04 -07:00
Keith Simmons 5051769dd3 Building, but failing test WIP 2022-04-27 17:25:38 -07:00
Antonio Scandurra abaf1f3452 Update share icon and swap its posiiton 2022-04-26 14:35:13 +02:00
Max Brunsfeld a43d10518d Infer completions old ranges based on the syntax tree 2022-04-25 13:14:05 -07:00
Max Brunsfeld 080691ccfa Respect lsp completions' 'insert_text' property when present
Fixes #839
2022-04-22 14:33:13 -07:00
Antonio Scandurra fb8f17bc80 Fix Project::test_rename 2022-04-22 15:59:20 +02:00
Antonio Scandurra fdfcbaa63b Return None when prepare rename is not available on language server 2022-04-22 15:43:23 +02:00
Max Brunsfeld fee4a096ff Use the 'jsonc' language id for all JSON files
This way, comments are allowed by the language server.
2022-04-21 12:08:16 -07:00
Antonio Scandurra a233f1fb91 Don't emit event when LSP reports consecutive empty diagnostics
This is related to #849: in that pull request we avoided *storing*
empty diagnostics, but we'd still report an event when receiving
consecutive empty diagnostics. So if the project diagnostics editor
was open, it could happen that opening a buffer would cause the
language server to report zero diagnostics. We would therefore close
the buffer because there were no diagnostics, but doing so would cause
the LSP to report another event with zero diagnostics. This would repeat
forever, causing Zed to use a lot of CPU and the UI not to refresh properly.

With this commit we will simply avoid emitting a `DiagnosticsUpdated` event
altogether if no diagnostics were present before *and* the LSP is reporting
a `PublishDiagnostics` event with no diagnostics in it.
2022-04-20 15:02:38 +02:00
Antonio ScandurraandNathan Sobo 1df22bbdec Remove summaries that don't contain any errors or warnings
When opening a buffer, some language servers might start reporting
diagnostics. When closing a buffer, they might report that no diagnostics
are present for that buffer. Previously, we would keep an empty summary entry
which would cause us to open a buffer in the project diagnostics view, only to
drop it because it contained no diagnostics. However, the act of opening it
caused the language server to asynchronously report non-empty diagnostics.
We would therefore handle this as an update, but the previous closing of the
buffer would cause the language server to report empty diagnostics again. This
would cause the project diagnostics view to thrash infinitely between these two
states, pegging the CPU and constantly refreshing the UI.

With this commit we won't maintain empty summary entries for files that contain
no diagnostics, which fixes the above issue.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-19 15:30:46 +02:00