WIP - Improve project diagnostic context rendering

This commit is contained in:
Max Brunsfeld 2021-12-16 18:09:12 -08:00
parent fb492a9fb8
commit 528d64d3cc
5 changed files with 225 additions and 114 deletions

View file

@ -357,7 +357,7 @@ pub enum SoftWrap {
Column(u32),
}
type BuildSettings = Arc<dyn 'static + Send + Sync + Fn(&AppContext) -> EditorSettings>;
pub type BuildSettings = Arc<dyn 'static + Send + Sync + Fn(&AppContext) -> EditorSettings>;
pub struct Editor {
handle: WeakViewHandle<Self>,
@ -3794,6 +3794,14 @@ pub fn diagnostic_header_renderer(
})
}
pub fn context_header_renderer(build_settings: BuildSettings) -> RenderHeaderFn {
Arc::new(move |cx| {
let settings = build_settings(cx);
let text_style = settings.style.text.clone();
Text::new("...".to_string(), text_style).boxed()
})
}
pub fn diagnostic_style(
severity: DiagnosticSeverity,
valid: bool,