Get diagnostics view almost building in the zed2 world

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Julia 2023-11-14 19:25:55 -05:00
parent 96f0257fb3
commit f4eb219c75
22 changed files with 2251 additions and 91 deletions

View file

@ -619,11 +619,11 @@ impl Pane {
self.items.iter()
}
// pub fn items_of_type<T: View>(&self) -> impl '_ + Iterator<Item = ViewHandle<T>> {
// self.items
// .iter()
// .filter_map(|item| item.as_any().clone().downcast())
// }
pub fn items_of_type<T: 'static>(&self) -> impl '_ + Iterator<Item = View<T>> {
self.items
.iter()
.filter_map(|item| item.to_any().clone().downcast().ok())
}
pub fn active_item(&self) -> Option<Box<dyn ItemHandle>> {
self.items.get(self.active_item_index).cloned()