WIP: Determine autoindents asynchronously

We still need to insert yield points in `compute_autoindents`.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-10-11 18:00:48 +02:00
parent 7f5d454b2d
commit 28ffd750ce
2 changed files with 252 additions and 228 deletions

View file

@ -12,18 +12,22 @@ pub struct Anchor {
pub version: clock::Global,
}
#[derive(Clone)]
pub struct AnchorMap<T> {
pub(crate) version: clock::Global,
pub(crate) entries: Vec<((usize, Bias), T)>,
}
#[derive(Clone)]
pub struct AnchorSet(pub(crate) AnchorMap<()>);
#[derive(Clone)]
pub struct AnchorRangeMap<T> {
pub(crate) version: clock::Global,
pub(crate) entries: Vec<(Range<(usize, Bias)>, T)>,
}
#[derive(Clone)]
pub struct AnchorRangeSet(pub(crate) AnchorRangeMap<()>);
impl Anchor {