Commit Graph
100 Commits
Author SHA1 Message Date
Nathan SoboandMax Brunsfeld c306ac007c Allow more time wrapping to complete synchronously
We're seeing occasional flickers and wondering if this will help.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-30 09:50:28 -07:00
Nathan Sobo e7d03af942 Fix moving to previous word across a wrap boundary
I'm just going to the end of the soft-wrapped line, mirroring the behavior with hard wraps. It's maybe not perfectly technically correct but that behavior would require us to consider word boundaries outside of the current line, which doesn't seem worth the complexity.
2021-07-30 09:50:28 -07:00
Nathan SoboandMax Brunsfeld aab51e7576 Add some incomplete tests for movement
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra 492a09f1be Fix movement across soft wrap boundaries
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra c779633154 Make unfolding inclusive
If the range *touches* the fold, we unfold. This was needed to fix the behavior for unfolding at the current selection position. Previously, there was some kind of translation issue that was allowing us to accidentally work the way we wanted without this.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra 38d4662a4e Only honor rightward bias for buffer points *inside* of folds
(Not at boundaries)

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra a6a8f4fd81 Introduce a struct for spanned_rows result
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra 029460bf7e Respect buffer row boundaries in line-oriented edit operations
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra 84fc8f0f4f Don't let people retry randomized tests
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra 6efadd19dd Reuse FontCache across randomized tests
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -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
Nathan Sobo 613192974f Don't render line numbers for soft-wrapped line segments 2021-07-30 09:50:28 -07:00
Nathan Sobo 47187172b7 Clip left when moving cursor to end of line
This ensures we stay on the same line when the current display line ends with a soft wrap.
2021-07-30 09:50:28 -07:00
Nathan Sobo b14721fd7f Clip left when moving vertically 2021-07-30 09:50:28 -07:00
Nathan Sobo 7a5f1b5446 Preserve logical scroll position when wrap width changes 2021-07-30 09:50:28 -07:00
Nathan Sobo 61b5d66ba8 Eliminate input/output nomenclature from fold_map
Instead, just use FoldPoint, FoldOffset, etc. We don't need the naming to be general because we know exactly which layer we're building on at each layer of the DisplayMap.
2021-07-25 08:22:50 -06:00
Nathan Sobo da50576129 Fix remaining errors and warnings 2021-07-25 07:56:53 -06:00
Nathan Sobo 9edc8b9a06 WIP 2021-07-24 08:40:48 -06:00
Nathan Sobo 3bf47be51e WIP 2021-07-24 08:09:04 -06:00
Nathan Sobo f81f043058 WIP 2021-07-23 12:25:09 -06:00
11285f3762 Pass a MutableAppContext to Element::layout and ::dispatch_event
We need to mutate the app in these cases to relay layout state, so this just makes things easier. We won't be able to perform layout in parallel but it's questionable whether we'll ever actually do that. If we do, we can revisit.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-23 10:52:08 -06:00
Nathan Sobo f169f8e358 Ensure that soft wrapped lines don't cause horizontal scrolling 2021-07-21 12:27:01 -06:00
Nathan Sobo 699e558db9 Remove logging 2021-07-21 11:21:13 -06:00
Nathan Sobo b513df3844 WIP 2021-07-20 17:22:03 -06:00
Nathan SoboandMax Brunsfeld ee213696aa Replace DeterministicExecutor::reset with forbid_parking
There's really no point calling reset if we plan on parking afterwards.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-20 12:28:04 -06:00
Nathan Sobo 64927abbc4 Allow DeterministicExecutor to park until forbid_parking is called
This allows us to perform async setup such as talking to the database.
2021-07-20 12:22:02 -06:00
Nathan SoboandMax Brunsfeld 3b77b011e2 Iterate on randomized wrapping test and fix some bugs
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-19 19:31:03 -06:00
Nathan SoboandMax Brunsfeld e0da3fd714 Get the randomized soft wrap test passing with no edits
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-19 18:37:29 -06:00
Nathan SoboandMax Brunsfeld 2ce42ff6b6 Honor the last line when wrapping even if it doesn't end in \n
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-19 18:29:20 -06:00
Nathan Sobo e193a660aa WIP 2021-07-19 13:59:07 -06:00
Nathan SoboandMax Brunsfeld 8b34deab58 Try to return edits from FoldMap::apply_edits
The goal is to describe how the fold map changed. Hopefully this is correct.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-15 15:08:18 -06:00
Nathan SoboandMax Brunsfeld 2c9f730638 Give the FoldMap its own edit type that does not have deleted_lines
We want to use this struct to communicate about edits performed to the fold map itself, and it will be simpler if we don't have to communicate this data.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-15 14:19:58 -06: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
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