Finished refactoring out fs and rope
This commit is contained in:
parent
0a8e2f6bb0
commit
0beb97547e
58 changed files with 328 additions and 223 deletions
|
@ -13,9 +13,11 @@ use crate::{
|
|||
};
|
||||
use anyhow::{anyhow, Result};
|
||||
use clock::ReplicaId;
|
||||
use fs::LineEnding;
|
||||
use futures::FutureExt as _;
|
||||
use gpui::{fonts::HighlightStyle, AppContext, Entity, ModelContext, MutableAppContext, Task};
|
||||
use parking_lot::Mutex;
|
||||
use rope::point::Point;
|
||||
use settings::Settings;
|
||||
use similar::{ChangeTag, TextDiff};
|
||||
use smol::future::yield_now;
|
||||
|
@ -38,7 +40,7 @@ use sum_tree::TreeMap;
|
|||
use text::operation_queue::OperationQueue;
|
||||
pub use text::{Buffer as TextBuffer, BufferSnapshot as TextBufferSnapshot, Operation as _, *};
|
||||
use theme::SyntaxTheme;
|
||||
use util::TryFutureExt as _;
|
||||
use util::{RandomCharIter, TryFutureExt as _};
|
||||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub use {tree_sitter_rust, tree_sitter_typescript};
|
||||
|
@ -368,7 +370,7 @@ impl Buffer {
|
|||
file,
|
||||
);
|
||||
this.text.set_line_ending(proto::deserialize_line_ending(
|
||||
proto::LineEnding::from_i32(message.line_ending)
|
||||
rpc::proto::LineEnding::from_i32(message.line_ending)
|
||||
.ok_or_else(|| anyhow!("missing line_ending"))?,
|
||||
));
|
||||
Ok(this)
|
||||
|
@ -1633,9 +1635,7 @@ impl Buffer {
|
|||
last_end = Some(range.end);
|
||||
|
||||
let new_text_len = rng.gen_range(0..10);
|
||||
let new_text: String = crate::random_char_iter::RandomCharIter::new(&mut *rng)
|
||||
.take(new_text_len)
|
||||
.collect();
|
||||
let new_text: String = RandomCharIter::new(&mut *rng).take(new_text_len).collect();
|
||||
|
||||
edits.push((range, new_text));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue