diagnostics: Keep diagnostic excerpt ranges properly ordered (#42298)
Fixes ZED-2CQ We were doing the binary search by buffer points, but due to await points within this function we could end up mixing points of differing buffer versions. Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -1148,9 +1148,9 @@ impl MultiBuffer {
|
||||
let mut counts: Vec<usize> = Vec::new();
|
||||
for range in expanded_ranges {
|
||||
if let Some(last_range) = merged_ranges.last_mut() {
|
||||
debug_assert!(
|
||||
assert!(
|
||||
last_range.context.start <= range.context.start,
|
||||
"Last range: {last_range:?} Range: {range:?}"
|
||||
"ranges must be sorted: {last_range:?} <= {range:?}"
|
||||
);
|
||||
if last_range.context.end >= range.context.start
|
||||
|| last_range.context.end.row + 1 == range.context.start.row
|
||||
|
||||
Reference in New Issue
Block a user