diff options
author | Aleksey Kladov <[email protected]> | 2020-05-05 22:15:49 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-05-05 22:15:49 +0100 |
commit | 4a6fa8f0dfcebbb4ea80394e5e4ca21f076f58f2 (patch) | |
tree | a639c6697f88528f35dc010ecf7c969cf4aaab56 /crates/ra_syntax/src/lib.rs | |
parent | 381cbc6088b6c4238b0f82df8ef37b552257ae59 (diff) |
Rename AtomTextEdit -> Indel
Diffstat (limited to 'crates/ra_syntax/src/lib.rs')
-rw-r--r-- | crates/ra_syntax/src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index d0234cada..1a7348dac 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -39,7 +39,7 @@ pub mod fuzz; | |||
39 | 39 | ||
40 | use std::{marker::PhantomData, sync::Arc}; | 40 | use std::{marker::PhantomData, sync::Arc}; |
41 | 41 | ||
42 | use ra_text_edit::AtomTextEdit; | 42 | use ra_text_edit::Indel; |
43 | use stdx::format_to; | 43 | use stdx::format_to; |
44 | 44 | ||
45 | use crate::syntax_node::GreenNode; | 45 | use crate::syntax_node::GreenNode; |
@@ -126,13 +126,13 @@ impl Parse<SourceFile> { | |||
126 | buf | 126 | buf |
127 | } | 127 | } |
128 | 128 | ||
129 | pub fn reparse(&self, edit: &AtomTextEdit) -> Parse<SourceFile> { | 129 | pub fn reparse(&self, indel: &Indel) -> Parse<SourceFile> { |
130 | self.incremental_reparse(edit).unwrap_or_else(|| self.full_reparse(edit)) | 130 | self.incremental_reparse(indel).unwrap_or_else(|| self.full_reparse(indel)) |
131 | } | 131 | } |
132 | 132 | ||
133 | fn incremental_reparse(&self, edit: &AtomTextEdit) -> Option<Parse<SourceFile>> { | 133 | fn incremental_reparse(&self, indel: &Indel) -> Option<Parse<SourceFile>> { |
134 | // FIXME: validation errors are not handled here | 134 | // FIXME: validation errors are not handled here |
135 | parsing::incremental_reparse(self.tree().syntax(), edit, self.errors.to_vec()).map( | 135 | parsing::incremental_reparse(self.tree().syntax(), indel, self.errors.to_vec()).map( |
136 | |(green_node, errors, _reparsed_range)| Parse { | 136 | |(green_node, errors, _reparsed_range)| Parse { |
137 | green: green_node, | 137 | green: green_node, |
138 | errors: Arc::new(errors), | 138 | errors: Arc::new(errors), |
@@ -141,8 +141,8 @@ impl Parse<SourceFile> { | |||
141 | ) | 141 | ) |
142 | } | 142 | } |
143 | 143 | ||
144 | fn full_reparse(&self, edit: &AtomTextEdit) -> Parse<SourceFile> { | 144 | fn full_reparse(&self, indel: &Indel) -> Parse<SourceFile> { |
145 | let text = edit.apply(self.tree().syntax().text().to_string()); | 145 | let text = indel.apply(self.tree().syntax().text().to_string()); |
146 | SourceFile::parse(&text) | 146 | SourceFile::parse(&text) |
147 | } | 147 | } |
148 | } | 148 | } |