aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-05 22:50:47 +0100
committerGitHub <[email protected]>2020-05-05 22:50:47 +0100
commit30eb458b4fa8adcecd8cbf731bd1cfa9a7a8b88b (patch)
tree1ee318a9568c8bf1d0b314ef996581bb4e518b9e /crates/ra_ide_db
parent78c82eff95cae43b389dbd6e590d7f09bac8f3f1 (diff)
parentca9e0f5fe9ad29ab0c5a0771a0d0eaec97e4104b (diff)
Merge #4332
4332: Refactor TextEdit r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r--crates/ra_ide_db/src/line_index_utils.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_db/src/line_index_utils.rs b/crates/ra_ide_db/src/line_index_utils.rs
index 039a12c0d..7fa6fc448 100644
--- a/crates/ra_ide_db/src/line_index_utils.rs
+++ b/crates/ra_ide_db/src/line_index_utils.rs
@@ -10,7 +10,7 @@
10use std::convert::TryInto; 10use std::convert::TryInto;
11 11
12use ra_syntax::{TextRange, TextSize}; 12use ra_syntax::{TextRange, TextSize};
13use ra_text_edit::{AtomTextEdit, TextEdit}; 13use ra_text_edit::{Indel, TextEdit};
14 14
15use crate::line_index::{LineCol, LineIndex, Utf16Char}; 15use crate::line_index::{LineCol, LineIndex, Utf16Char};
16 16
@@ -182,14 +182,14 @@ struct TranslatedEdit<'a> {
182} 182}
183 183
184struct Edits<'a> { 184struct Edits<'a> {
185 edits: &'a [AtomTextEdit], 185 edits: &'a [Indel],
186 current: Option<TranslatedEdit<'a>>, 186 current: Option<TranslatedEdit<'a>>,
187 acc_diff: i64, 187 acc_diff: i64,
188} 188}
189 189
190impl<'a> Edits<'a> { 190impl<'a> Edits<'a> {
191 fn from_text_edit(text_edit: &'a TextEdit) -> Edits<'a> { 191 fn from_text_edit(text_edit: &'a TextEdit) -> Edits<'a> {
192 let mut x = Edits { edits: text_edit.as_atoms(), current: None, acc_diff: 0 }; 192 let mut x = Edits { edits: text_edit.as_indels(), current: None, acc_diff: 0 };
193 x.advance_edit(); 193 x.advance_edit();
194 x 194 x
195 } 195 }