Render basic diagnostic messages in project diagnostics view
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
ad05c0cc7a
commit
e1a2897d53
4 changed files with 145 additions and 98 deletions
|
@ -3,7 +3,9 @@ mod fold_map;
|
|||
mod tab_map;
|
||||
mod wrap_map;
|
||||
|
||||
use crate::{Anchor, MultiBuffer, MultiBufferSnapshot, ToOffset, ToPoint};
|
||||
use crate::{
|
||||
multi_buffer::RenderHeaderFn, Anchor, MultiBuffer, MultiBufferSnapshot, ToOffset, ToPoint,
|
||||
};
|
||||
use block_map::{BlockMap, BlockPoint};
|
||||
use fold_map::{FoldMap, ToFoldPoint as _};
|
||||
use gpui::{fonts::FontId, ElementBox, Entity, ModelContext, ModelHandle};
|
||||
|
@ -327,6 +329,21 @@ impl DisplaySnapshot {
|
|||
self.blocks_snapshot.blocks_in_range(rows)
|
||||
}
|
||||
|
||||
pub fn excerpt_headers_in_range<'a>(
|
||||
&'a self,
|
||||
rows: Range<u32>,
|
||||
) -> impl 'a + Iterator<Item = (Range<u32>, RenderHeaderFn)> {
|
||||
let start_row = DisplayPoint::new(rows.start, 0).to_point(self).row;
|
||||
let end_row = DisplayPoint::new(rows.end, 0).to_point(self).row;
|
||||
self.buffer_snapshot
|
||||
.excerpt_headers_in_range(start_row..end_row)
|
||||
.map(move |(rows, render)| {
|
||||
let start_row = Point::new(rows.start, 0).to_display_point(self).row();
|
||||
let end_row = Point::new(rows.end, 0).to_display_point(self).row();
|
||||
(start_row..end_row, render)
|
||||
})
|
||||
}
|
||||
|
||||
pub fn intersects_fold<T: ToOffset>(&self, offset: T) -> bool {
|
||||
self.folds_snapshot.intersects_fold(offset)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue