diff options
author | Adolfo OchagavĂa <[email protected]> | 2018-11-04 15:45:22 +0000 |
---|---|---|
committer | Adolfo OchagavĂa <[email protected]> | 2018-11-04 20:16:38 +0000 |
commit | 3b42ddae601fbd73f672e82028e04c3abdf1252d (patch) | |
tree | d63c4114d2fccf1c085502dfd1048b4b5f68266b /crates/ra_syntax/src/reparsing.rs | |
parent | 576b9a0727ebbf00521bc1131cda808145696d06 (diff) |
Introduce SyntaxErrorKind and TextRange in SyntaxError
Diffstat (limited to 'crates/ra_syntax/src/reparsing.rs')
-rw-r--r-- | crates/ra_syntax/src/reparsing.rs | 12 |
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 |