In the status bar, show the diagnostic under the cursor

This commit is contained in:
Max Brunsfeld 2021-11-03 12:33:16 -07:00
parent 941d935c4a
commit 8b5089c759
5 changed files with 95 additions and 3 deletions

View file

@ -780,10 +780,14 @@ impl Buffer {
Ok(Operation::UpdateDiagnostics(self.diagnostics.clone()))
}
pub fn diagnostics_in_range<'a, T: 'a + ToOffset>(
pub fn diagnostics_in_range<'a, T, O>(
&'a self,
range: Range<T>,
) -> impl Iterator<Item = (Range<Point>, &Diagnostic)> + 'a {
) -> impl Iterator<Item = (Range<O>, &Diagnostic)> + 'a
where
T: 'a + ToOffset,
O: 'a + FromAnchor,
{
let content = self.content();
self.diagnostics
.intersecting_ranges(range, content, true)