more enterprisey assists API

This commit is contained in:
Aleksey Kladov 2019-01-03 18:59:17 +03:00
parent aea2183799
commit a4635a199b
11 changed files with 287 additions and 210 deletions

View file

@ -7,15 +7,12 @@ pub struct TextEdit {
atoms: Vec<AtomTextEdit>,
}
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct TextEditBuilder {
atoms: Vec<AtomTextEdit>,
}
impl TextEditBuilder {
pub fn new() -> TextEditBuilder {
TextEditBuilder { atoms: Vec::new() }
}
pub fn replace(&mut self, range: TextRange, replace_with: String) {
self.atoms.push(AtomTextEdit::replace(range, replace_with))
}