Clip diagnostic range before and during empty range expansion

Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Julia 2022-11-23 13:20:47 -05:00
parent e51cbf67ab
commit b58ae8bdd7
3 changed files with 10 additions and 7 deletions

View file

@ -1337,7 +1337,7 @@ fn test_random_collaboration(cx: &mut MutableAppContext, mut rng: StdRng) {
(0..entry_count).map(|_| {
let range = buffer.random_byte_range(0, &mut rng);
let range = range.to_point_utf16(buffer);
let range = Unclipped(range.start)..Unclipped(range.end);
let range = range.start..range.end;
DiagnosticEntry {
range,
diagnostic: Diagnostic {