Commit graph

23 commits

Author SHA1 Message Date
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 Brunsfeld
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
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
e071d40058 Use a single Bias enum everywhere 2021-06-04 13:39:57 +02:00
Max Brunsfeld
2c8d5973f3 Add a hand-written error message for the seek_internal precondition 2021-06-02 16:28:27 -07:00
Max Brunsfeld
657b0affd5 Avoid unnecessarily adding internal summaries in Cursor::next 2021-06-02 14:43:17 -07:00
Max Brunsfeld
d83a046911 Avoid calling SumTree::extent in Cursor::suffix 2021-06-02 13:51:52 -07:00
Antonio Scandurra
da7e3c8cd8 Implement anchors using an offset + a version vector 2021-06-01 15:28:20 +02:00
Antonio Scandurra
311e1b0f5e Supply a context when adding summary to Dimension 2021-06-01 12:50:10 +02:00
Antonio Scandurra
32fbdfeab5 Avoid calling add_summary twice in sum_tree::Cursor
As I was looking into `SumTree` for the upcoming round of changes to the
buffer, I noticed that we were inadvertently adding summaries twice
every time we skipped over a node in the tree.

This is a pretty heavy code path that's pretty ubiquitous in the
codebase, so this commit gets rid of the unnecessary addition.
2021-05-31 16:45:57 +02:00
Max Brunsfeld
173f99748d Rename context parameters to cx in sum_tree 2021-05-28 15:32:24 -07:00
Antonio Scandurra
e8179f7e3e Always provide a context to sum tree's methods
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-06 19:29:38 +02:00
Antonio Scandurra
178705f8f9 Add FoldMap::folds_in_range to randomized test and fix issues it found 2021-05-06 18:49:41 +02:00
Antonio Scandurra
652fc9e4ec Remove add_summary_with_ctx and always require a ctx in add_summary 2021-05-06 16:57:47 +02:00
Antonio Scandurra
901525bf77 Implement FoldMap's folds using a SumTree
This required passing a `Context` object to `Summary` and introducing a
new `SeekDimension` trait that allows comparing two dimensions and pass
an additional context object.
2021-05-06 16:20:23 +02:00
Antonio Scandurra
7fb7a6adfc Add a Summary trait in preparation of passing a context struct 2021-05-06 09:32:14 +02:00
Nathan Sobo
dced9469f5 WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-23 12:47:23 -06:00
Antonio Scandurra
070069d65e Ensure top of cursor stack is either empty or a leaf node
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-04-15 18:12:56 +02:00
Antonio Scandurra
7b6fbe1d89 Compute minimal version_in_range on edit and account for undo 2021-04-09 11:22:22 +02:00
Max Brunsfeld
32500e21f6 Silence sum_tree warnings
* Remove unused enum variant
* Add #[allow(unused)] for non-trivial methods
2021-04-02 14:39:56 -07:00
Nathan Sobo
356bc41752 WIP 2021-03-09 21:00:51 -07:00