diff options
author | Bernardo <[email protected]> | 2018-12-11 18:07:17 +0000 |
---|---|---|
committer | Bernardo <[email protected]> | 2018-12-11 18:07:17 +0000 |
commit | 0527e3b283af0153cf13fa64fe73862a5b7655c8 (patch) | |
tree | 07c4eacaad717ea802ab26972f45223281f2c9c1 /crates/ra_syntax/src/lib.rs | |
parent | 7344d28768c43d8955bf23c183d606be08f27c64 (diff) |
rename Edit to TextEdit and AtomEdit to AtomTextEdit
Diffstat (limited to 'crates/ra_syntax/src/lib.rs')
-rw-r--r-- | crates/ra_syntax/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 7295fb237..34a3aabef 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -47,7 +47,7 @@ pub use crate::{ | |||
47 | }, | 47 | }, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | use ra_text_edit::AtomEdit; | 50 | use ra_text_edit::AtomTextEdit; |
51 | use crate::yellow::GreenNode; | 51 | use crate::yellow::GreenNode; |
52 | 52 | ||
53 | /// `SourceFileNode` represents a parse tree for a single Rust file. | 53 | /// `SourceFileNode` represents a parse tree for a single Rust file. |
@@ -68,15 +68,15 @@ impl SourceFileNode { | |||
68 | parser_impl::parse_with(yellow::GreenBuilder::new(), text, &tokens, grammar::root); | 68 | parser_impl::parse_with(yellow::GreenBuilder::new(), text, &tokens, grammar::root); |
69 | SourceFileNode::new(green, errors) | 69 | SourceFileNode::new(green, errors) |
70 | } | 70 | } |
71 | pub fn reparse(&self, edit: &AtomEdit) -> SourceFileNode { | 71 | pub fn reparse(&self, edit: &AtomTextEdit) -> SourceFileNode { |
72 | self.incremental_reparse(edit) | 72 | self.incremental_reparse(edit) |
73 | .unwrap_or_else(|| self.full_reparse(edit)) | 73 | .unwrap_or_else(|| self.full_reparse(edit)) |
74 | } | 74 | } |
75 | pub fn incremental_reparse(&self, edit: &AtomEdit) -> Option<SourceFileNode> { | 75 | pub fn incremental_reparse(&self, edit: &AtomTextEdit) -> Option<SourceFileNode> { |
76 | reparsing::incremental_reparse(self.syntax(), edit, self.errors()) | 76 | reparsing::incremental_reparse(self.syntax(), edit, self.errors()) |
77 | .map(|(green_node, errors)| SourceFileNode::new(green_node, errors)) | 77 | .map(|(green_node, errors)| SourceFileNode::new(green_node, errors)) |
78 | } | 78 | } |
79 | fn full_reparse(&self, edit: &AtomEdit) -> SourceFileNode { | 79 | fn full_reparse(&self, edit: &AtomTextEdit) -> SourceFileNode { |
80 | let text = | 80 | let text = |
81 | text_utils::replace_range(self.syntax().text().to_string(), edit.delete, &edit.insert); | 81 | text_utils::replace_range(self.syntax().text().to_string(), edit.delete, &edit.insert); |
82 | SourceFileNode::parse(&text) | 82 | SourceFileNode::parse(&text) |