Commit Graph
26 Commits
Author SHA1 Message Date
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
Max BrunsfeldandNathan Sobo 139bcb8304 Rename foo/mod.rs files too foo.rs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-28 14:41:58 -07:00
Antonio Scandurra 84e0efe5df Save a few allocations when pushing to a SumTree 2021-05-18 17:34:36 +02:00
Antonio ScandurraandNathan Sobo 580fc4fed7 Clarify variable and method names
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-14 16:42:46 +02:00
Antonio Scandurra e48973f75a Start on a SumTree-based Rope implementation 2021-05-14 11:33:39 +02:00
Antonio ScandurraandMax Brunsfeld 7b98fb33dd WIP: Get the type checker passing...
...but not the borrow checker!

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-05-13 19:24:03 +02:00
Antonio ScandurraandNathan Sobo 0e9441e5cd WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-13 18:35:48 +02:00
Antonio ScandurraandNathan Sobo 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
Antonio Scandurra 9cd1d5e607 Avoid cloning entry in Snapshot::entry_for_path 2021-04-24 10:14:17 +02:00
Nathan SoboandMax Brunsfeld dced9469f5 WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-23 12:47:23 -06:00
Antonio Scandurra b68b0fce56 Add simple unit test for SumTree::{edit,get} 2021-04-16 16:26:40 +02:00
Antonio Scandurra 457d945376 Avoid unnecessary cloning of items when calling SumTree::edit 2021-04-16 16:16:46 +02:00
Antonio Scandurra fd12117288 Start on rescanning Worktree 2021-04-16 15:25:43 +02:00
Antonio ScandurraandNathan Sobo cefc753123 Re-introduce fuzzy-matching on the new WorkTree implementation
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-15 18:18:53 +02:00
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 0bbff090f0 WIP 2021-04-15 12:10:37 +02:00
Nathan Sobo 36e6ed3aef WIP 2021-04-14 12:38:16 -06: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
Antonio Scandurra a88b63d83c Ensure FoldMap always contains at least one transform
Previously, when splicing an edit that deleted all transforms, we would
leave the `FoldMap` empty, thus violating a bunch of downstream
invariants and e.g. causing the `BufferRows` iterator to not return any
buffer row.

This commit ensures we always have at least one transform (an isomorphic
one, specifically) and adds additional test coverage for the
`FoldMap::buffer_rows` method by adding it to the randomized tests.
2021-03-29 10:18:28 +02:00
Nathan Sobo 356bc41752 WIP 2021-03-09 21:00:51 -07:00