Implement MultiBufferSnapshot::excerpt_headers_in_range

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo 2021-12-14 16:24:48 -07:00
parent 60e2c6bc52
commit ad05c0cc7a
3 changed files with 110 additions and 12 deletions

View file

@ -1,3 +1,5 @@
use std::sync::Arc;
use collections::HashMap;
use editor::{Editor, ExcerptProperties, MultiBuffer};
use gpui::{
@ -64,6 +66,13 @@ impl ProjectDiagnostics {
buffer: &buffer,
range: diagnostic.range,
header_height: 1,
render_header: Some(Arc::new({
let message = diagnostic.diagnostic.message.clone();
move |_| {
Text::new(message.clone(), Default::default())
.boxed()
}
})),
},
cx,
);