aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/reparsing.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/reparsing.rs')
-rw-r--r--crates/ra_syntax/src/reparsing.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/reparsing.rs b/crates/ra_syntax/src/reparsing.rs
index b3b51b3e4..9f5baf1ef 100644
--- a/crates/ra_syntax/src/reparsing.rs
+++ b/crates/ra_syntax/src/reparsing.rs
@@ -165,19 +165,19 @@ fn merge_errors(
165) -> Vec<SyntaxError> { 165) -> Vec<SyntaxError> {
166 let mut res = Vec::new(); 166 let mut res = Vec::new();
167 for e in old_errors { 167 for e in old_errors {
168 if e.offset <= old_node.range().start() { 168 if e.range.start() <= old_node.range().start() {
169 res.push(e) 169 res.push(e)
170 } else if e.offset >= old_node.range().end() { 170 } else if e.range.start() >= old_node.range().end() {
171 res.push(SyntaxError { 171 res.push(SyntaxError {
172 msg: e.msg, 172 kind: e.kind,
173 offset: e.offset + TextUnit::of_str(&edit.insert) - edit.delete.len(), 173 range: e.range + TextUnit::of_str(&edit.insert) - edit.delete.len(),
174 }) 174 })
175 } 175 }
176 } 176 }
177 for e in new_errors { 177 for e in new_errors {
178 res.push(SyntaxError { 178 res.push(SyntaxError {
179 msg: e.msg, 179 kind: e.kind,
180 offset: e.offset + old_node.range().start(), 180 range: e.range + old_node.range().start(),
181 }) 181 })
182 } 182 }
183 res 183 res