Commit Graph
100 Commits
Author SHA1 Message Date
Nathan Sobo a074f4664b Merge pull request #109 from zed-industries/server
Include contents of the zed-server repo
2021-07-13 15:52:00 -06:00
Nathan SoboandMax Brunsfeld 82569a031f Fix race condition in integration test
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-13 13:24:48 -06:00
Nathan SoboandMax Brunsfeld 411e7df931 Move Fs trait into its own module
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-13 12:52:42 -06:00
Nathan SoboandMax Brunsfeld 86ca442fbe Fix CSS purge path
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-12 14:50:51 -06:00
Nathan SoboandMax Brunsfeld 9a6c4a1718 Pass arguments to cargo run in script/server
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-12 14:50:39 -06:00
Nathan SoboandMax Brunsfeld 1537500fcb Include contents of the zed-server repo
We're going full monorepo.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-12 14:14:39 -06:00
Nathan Sobo 4aab70d7fb Remove authentication at the RPC layer
This means we can remove IOHandler and return a simple future that is Send
2021-07-09 21:57:10 -06:00
Nathan Sobo 89ef4d760d Send an Authorization HTTP header when connecting web sockets 2021-07-09 21:27:33 -06:00
Nathan Sobo 4ffd29bd81 Pass AppState as action arg to workspace:share_worktree 2021-07-09 21:26:54 -06:00
Nathan SoboandMax Brunsfeld 73db910a95 Process remote worktree updates in the background
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-05 14:20:53 -06:00
Nathan SoboandMax Brunsfeld 036dcd50fd Start on applying remote worktree updates in the background
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-05 13:44:42 -06:00
Nathan Sobo 0fde7a55ef Store shared buffers on LocalWorktree
It's okay for our domain objects to model remote state. We should minimize what we need to store in the rpc::ClientState struct.
2021-06-29 21:01:43 -06: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
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
Nathan SoboandAntonio Scandurra 1793eda470 Eagerly populate worktree entries on load
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-06-28 12:29:46 -06: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
Nathan SoboandMax Brunsfeld 2257abd7dd Add Entity release hooks
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-25 10:35:06 -06:00
Nathan Sobo 3ba22230dc Merge pull request #97 from zed-industries/limit-bundle-uploads
Only upload artifacts to workflow runs on the main branch
2021-06-24 19:07:04 -06:00
Nathan Sobo 0faabc2177 Only upload artifacts to workflow runs on the main branch
We're running out of actions storage, and we don't really need an artifact stored for every single build.
2021-06-24 19:02:57 -06:00
Nathan Sobo c4729de913 Merge pull request #96 from zed-industries/retry-flaky-tests
Add a "retries" option to gpui::test macro and use it in flaky tests
2021-06-24 18:08:06 -06:00
Nathan Sobo 8f7111b0f7 Upgrade bindgen to fix warnings on new Rust 2021-06-24 18:02:53 -06:00
Nathan Sobo 3d67266d0b Add a "retries" option to gpui::test macro and use it in flaky tests 2021-06-24 17:51:16 -06: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
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
Nathan SoboandMax Brunsfeld 8ae5c0d7d6 Implement worktree::Snapshot::diff
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-21 15:08:21 -06:00
Nathan SoboandMax Brunsfeld 1364ba6f5e Allow async background work when polling worktree background snapshot
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>
2021-06-21 14:03:29 -06:00
Nathan SoboandMax Brunsfeld 986afd26e9 Remove other_mount_paths
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>
2021-06-21 13:06:29 -06:00
Nathan SoboandMax Brunsfeld 0deaa3a61d WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-18 17:26:12 -06:00
Nathan SoboandMax Brunsfeld bfccb173c4 Update prost to include our changes
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-18 15:12:22 -06:00
Nathan Sobo 66c76d5469 Test creating a new empty workspace and fix test compile errors 2021-06-09 16:38:32 -06:00
Nathan Sobo b5cb41c7f0 Open a new workspace on File > New if none exists 2021-06-09 15:34:45 -06:00
Nathan SoboandMax Brunsfeld 3a932cc9bf Rename MainThreadPlatform to ForegroundPlatform and fix crash on quit
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-07 17:42:49 -06:00
Nathan SoboandMax Brunsfeld 6daddf5146 Allow platform references to be sent to background threads
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-07 17:35:27 -06:00
Nathan SoboandMax Brunsfeld ebbe517bfa Move path prompting methods to MainThreadPlatform
They need to call back into the main thread, meaning the callbacks can't be Send + Sync.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-07 17:32:03 -06:00
Nathan SoboandMax Brunsfeld 7b98994d1f Rename PlatformLifecycle to MainThreadPlatform
Don't love it, but at least it's accurate.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-07 17:21:34 -06:00
Nathan Sobo 14b519f78d Extract a platform::Lifecycle trait
This will allow us to make platform::Platform be Send + Sync and keep the lifecycle on the main thread.
2021-06-07 17:02:24 -06:00
Nathan SoboandMax Brunsfeld 74b07fed18 WIP: Start representing edit operations with versions and multiple ranges
Compiling, long way to go though.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-06-01 17:25:23 -06:00
Nathan Sobo 6d83ed2824 Add RPC implementation details to the collaboration plan 2021-05-31 17:40:39 -06:00
Nathan Sobo 081191917c Add more emacs-inspired bindings
Word-wise movement and columnar selection without reaching for the arrows.
2021-05-29 12:06:52 -06:00
Nathan Sobo ff2ab4b72d Merge pull request #75 from zed-industries/naming-cleanup
Clean up naming conventions project-wide
2021-05-28 16:42:20 -06:00
Nathan Sobo e9bd872b06 Implement buffer::move_to_enclosing_bracket 2021-05-28 12:07:30 -06:00
Nathan Sobo eb345e7182 Merge pull request #71 from zed-industries/simplify-text-layout
Pass scalar lengths and include colors when specifying styling runs during text layout
2021-05-21 14:40:48 -06:00
Nathan Sobo 5d614e7e54 Fix test assertions 2021-05-21 14:36:52 -06:00
Nathan Sobo 2c122eb253 Fix typo 2021-05-21 14:36:44 -06:00
Nathan Sobo b075b0108d Clarify variable name 2021-05-21 14:14:05 -06:00
Nathan Sobo 92ff7f4e5e Accept colors in styling runs passed to layout_str
Also move from the runs being expressed as ranges to the runs being expressed as a sequence of contiguous scalar lengths.
2021-05-21 14:10:38 -06:00
Nathan Sobo fd3b2c38eb Try a diff upload action 2021-05-17 23:39:01 -06:00
Nathan Sobo f7b37cdf54 Merge pull request #66 from zed-industries/upload-release
Add a release upload action
2021-05-17 23:04:55 -06:00
Nathan Sobo aef21e1c0b Try not cleaning on checkout 2021-05-17 22:46:33 -06:00
Nathan Sobo f7e8e21d74 Reenable tests 2021-05-17 21:57:07 -06:00
Nathan Sobo 614d74948c 🤦‍♂️ 2021-05-17 21:33:08 -06:00
Nathan Sobo 6c51ce9595 Merge remote-tracking branch 'origin/master' into upload-release 2021-05-17 21:12:14 -06:00
Nathan Sobo c52968b18e Merge pull request #67 from zed-industries/delay-polling
Reintroduce the 100ms delay when polling worktree entries
2021-05-17 21:11:36 -06:00
Nathan Sobo f6bb550fb1 Revert "Does this make job setup faster?"
This reverts commit e8985b46dd.
2021-05-17 20:58:03 -06:00
Nathan Sobo e8985b46dd Does this make job setup faster? 2021-05-17 20:55:42 -06:00
Nathan Sobo 143ea24875 Reintroduce the 100ms delay when polling worktree entries
This regressed when I switched us over to the simplified async approach. I think it was causing us to contend on the mutex on during startup.
2021-05-17 20:50:00 -06:00
Nathan Sobo a750a09002 Merge remote-tracking branch 'origin/master' into upload-release 2021-05-17 18:27:19 -06:00
Nathan Sobo 6429123881 Remove unnecessary step 2021-05-17 18:09:35 -06:00
Nathan Sobo 693a96f0e5 Explicitly install aarch64 target 2021-05-17 18:07:39 -06:00
Nathan Sobo 7f2da31708 Install cargo-bundle if needed in script/bundle 2021-05-17 17:57:50 -06:00
Nathan Sobo 08c7a499e5 Focus on bundling 2021-05-17 17:51:48 -06:00
Nathan Sobo 667aa947e6 Will you work please? 2021-05-17 17:51:06 -06:00
Nathan Sobo 4a3f3be40d Can we skip caching because we're self hosted? 2021-05-17 16:48:03 -06:00
Nathan Sobo 28988fcbb5 Run CI on tag pushes 2021-05-17 16:47:42 -06:00
Nathan Sobo 4f8caedf94 Add a release upload action 2021-05-17 16:38:56 -06:00
Nathan Sobo d234f63447 Update roadmap 2021-05-17 11:15:32 -06:00
Nathan Sobo cba8603335 WIP 2021-05-14 10:58:02 -06:00
Nathan Sobo 9dac491ed5 Don't remove entities whose ref count has become positive again 2021-05-12 19:29:17 -06:00
Nathan Sobo e81a28e57e Remove dropped entities after every effect 2021-05-12 19:28:48 -06:00
Nathan Sobo a3be5595dd Pass a handle to the current view model when spawning
Most of the time, we'll want a way to get a reference back to the current view or model, so this facilitates that common case.
2021-05-12 15:28:59 -06:00
Nathan SoboandMax Brunsfeld fa6bd1f926 Introduce AsyncAppContext and simplify spawning
Now when you call spawn in various context, you pass an FnOnce that is called with an AsyncAppContext and returns a static future. This allows you to write async code similar to how our tests work, borrowing the guts of the AsyncAppContext when needed to interact, but using normal async await semantics instead of callbacks.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-05-12 15:16:49 -06:00
Nathan Sobo 76d9a40f35 Merge pull request #40 from zed-industries/close-window
Correctly handle closing windows and removing entities
2021-05-08 09:06:54 -06:00
Nathan Sobo 2c74d75687 Fix double borrow error in Window::on_close callbacks when quitting app
The simplest solution I could come up with was to make quitting the app asynchronous. Calling mac::Platform::quit enqueues a request to quit the app and then allows the call stack to fully return. This ensures we aren't holding a borrow when we quit and invoke all the Window::on_close callbacks. Seems like it should be fine to be async on quitting.
2021-05-08 08:49:14 -06:00
318e8abf2f Avoid redundant entity refcount operations
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-05-07 14:15:43 -07:00
Nathan Sobo 1c50059575 Merge pull request #38 from zed-industries/new-file
Allow creating untitled buffers and saving them to new files
2021-05-07 13:57:09 -06:00
Nathan SoboandAntonio Scandurra b5f1f31693 Fix focus test
Call on_focus on the root view when the window is originally created. Test dropping a focused view. Simplify test to avoid relying on emitting events.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-05-07 09:43:07 -06:00
Nathan SoboandMax Brunsfeld 35e0eaaae2 Refocus root view if focused view is removed
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-05-06 16:30:10 -06:00
Nathan SoboandMax Brunsfeld 5e08a02ca8 Don't retain entities after EntityTasks are dropped
This allows us to spawn long-running tasks without leaking entities, but it also ensures that if we *do* hold on to a task, that the entity exists until the future or stream complete so that the task doesn't need to return an Option type.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-05-06 16:19:38 -06:00
Nathan SoboandMax Brunsfeld 4eac765f1a Replace zed::watch with postage::watch for settings
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-05-06 15:27:18 -06:00
Nathan SoboandMax Brunsfeld ab10e27424 Create a pending view handle before creating a view
This way, if we create and drop a handle during the creation of a view, we don't drop the view before we have a chance to increment its initial reference count.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-05-06 15:18:09 -06:00
Nathan SoboandMax Brunsfeld f408521d12 Gracefully handle a view being updated and removed in the same tick
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-05-06 15:13:26 -06:00
Nathan SoboandMax Brunsfeld 008f2b905b Hold a WeakViewHandle in BufferElement
Otherwise, the element never goes away because the view never goes away because the element is holding a strong reference.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-05-06 15:13:01 -06:00
Nathan Sobo 7717700b2c Implement Drop on AnyViewHandle
This was a pretty bad oversight.
2021-05-05 23:21:39 -06:00
Nathan Sobo 6cb656db9a Require window to have a root view and focused view
This is possible now that the window doesn't need to own the view. We can create the root view before we create the window.
2021-05-05 23:21:19 -06:00
Nathan Sobo 45a01d1526 Don't store views on windows
Instead, store all views in a single top-level map that's keyed by window id and view id. This ensures we'll keep a view alive even if its window is gone, so long as we're holding a handle. This can happen with things like spawned tasks. We don't want to panic during a spawned task after we close the window.
2021-05-05 22:48:16 -06:00
Nathan Sobo 3f844bc953 Fix crash when closing windows 2021-05-05 11:34:49 -06:00
Nathan Sobo 2ce9f271b5 Merge pull request #30 from zed-industries/bundle
WIP: Create and upload application bundle in CI
2021-05-04 18:02:47 -06:00
Nathan Sobo a0471a5447 Add ~/.rustup to the list of cached paths
And restore skipping of rust install if it hasn't changed.
2021-05-04 17:46:44 -06:00
Nathan Sobo 13e524d9ed Try to disable caching 2021-05-04 17:38:05 -06:00
Nathan Sobo 3604d7e292 Try to fix target not being installed 2021-05-04 17:34:03 -06:00
Nathan Sobo 5cf65ed6b7 Ad hoc code-sign the app bundle
Apparently this is necessary to run on the M1 macs
2021-05-04 17:29:39 -06:00
Nathan Sobo 52a5777fbd Create the bundle as a "fat binary" supporting the M1 2021-05-04 17:18:25 -06:00
Nathan Sobo 1f06d216b5 Fix artifact name 2021-05-04 17:18:25 -06:00
Nathan Sobo 2dc1176486 Create and upload a DMG 2021-05-04 17:18:25 -06:00
Nathan Sobo 8297f2a941 Attempt to upload app bundle as an artifact 2021-05-04 17:18:25 -06:00
Nathan Sobo 898271edfb Add script/bundle, which creates a macOS app bundle 2021-05-04 17:18:25 -06:00
Nathan Sobo 5c392f933f Merge branch 'master' into buffer-per-inode 2021-05-03 20:47:28 -06:00
Nathan Sobo 8820df7912 Rename WorkspaceView to Workspace and reorganize module 2021-05-03 20:42:32 -06:00
Nathan Sobo 366f8fcdb0 Inline methods previously moved from Workspace 2021-05-03 20:36:12 -06:00