diff options
Diffstat (limited to 'crates/ra_syntax/src/reparsing.rs')
-rw-r--r-- | crates/ra_syntax/src/reparsing.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/crates/ra_syntax/src/reparsing.rs b/crates/ra_syntax/src/reparsing.rs index b3b51b3e4..3c4ea5c22 100644 --- a/crates/ra_syntax/src/reparsing.rs +++ b/crates/ra_syntax/src/reparsing.rs | |||
@@ -165,20 +165,14 @@ 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.offset() <= 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.offset() >= old_node.range().end() { |
171 | res.push(SyntaxError { | 171 | res.push(e.add_offset(TextUnit::of_str(&edit.insert) - edit.delete.len())); |
172 | msg: e.msg, | ||
173 | offset: e.offset + TextUnit::of_str(&edit.insert) - edit.delete.len(), | ||
174 | }) | ||
175 | } | 172 | } |
176 | } | 173 | } |
177 | for e in new_errors { | 174 | for e in new_errors { |
178 | res.push(SyntaxError { | 175 | res.push(e.add_offset(old_node.range().start())); |
179 | msg: e.msg, | ||
180 | offset: e.offset + old_node.range().start(), | ||
181 | }) | ||
182 | } | 176 | } |
183 | res | 177 | res |
184 | } | 178 | } |