diff options
author | Leander Tentrup <[email protected]> | 2020-04-17 21:23:23 +0100 |
---|---|---|
committer | Leander Tentrup <[email protected]> | 2020-04-17 21:50:30 +0100 |
commit | 2e2c03ee2d7ef20fd6e20151507d26a4407c835e (patch) | |
tree | ee8cc13d15c16fdaa60c9a1156456b4bc62d7dda /crates/ra_ide/src/syntax_highlighting.rs | |
parent | 8a4cebafca257f6d3294744d0e9e3d461c954645 (diff) |
Fix incorrect order of syntax highlight ranges
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 83d161f45..7b15b82bd 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -174,7 +174,8 @@ pub(crate) fn highlight( | |||
174 | } | 174 | } |
175 | 175 | ||
176 | assert_eq!(res.len(), 1, "after DFS traversal, the stack should only contain a single element"); | 176 | assert_eq!(res.len(), 1, "after DFS traversal, the stack should only contain a single element"); |
177 | let res = res.pop().unwrap(); | 177 | let mut res = res.pop().unwrap(); |
178 | res.sort_by_key(|range| range.range.start()); | ||
178 | // Check that ranges are sorted and disjoint | 179 | // Check that ranges are sorted and disjoint |
179 | assert!(res | 180 | assert!(res |
180 | .iter() | 181 | .iter() |