Extend empty diagnostic ranges by one character

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-10-29 19:09:19 +02:00
parent 6212ebad9b
commit b571eae4f3

View File

@ -710,8 +710,12 @@ impl Buffer {
end = last_edit_new_end + (end - last_edit_old_end);
}
let range = content.clip_point_utf16(start, Bias::Left)
let mut range = content.clip_point_utf16(start, Bias::Left)
..content.clip_point_utf16(end, Bias::Right);
if range.start == range.end {
range.end.column += 1;
range.end = content.clip_point_utf16(range.end, Bias::Right);
}
Some((range, (severity, diagnostic.message)))
}),
)