diff --git a/crates/collab_ui/src/channel_view.rs b/crates/collab_ui/src/channel_view.rs index 5086cc8b37..a09073c55d 100644 --- a/crates/collab_ui/src/channel_view.rs +++ b/crates/collab_ui/src/channel_view.rs @@ -15,7 +15,7 @@ use gpui::{ ViewContext, ViewHandle, }; use project::Project; -use std::any::Any; +use std::any::{Any, TypeId}; use workspace::{ item::{FollowableItem, Item, ItemHandle}, register_followable_item, @@ -189,6 +189,21 @@ impl View for ChannelView { } impl Item for ChannelView { + fn act_as_type<'a>( + &'a self, + type_id: TypeId, + self_handle: &'a ViewHandle, + _: &'a AppContext, + ) -> Option<&'a AnyViewHandle> { + if type_id == TypeId::of::() { + Some(self_handle) + } else if type_id == TypeId::of::() { + Some(&self.editor) + } else { + None + } + } + fn tab_content( &self, _: Option, diff --git a/crates/workspace/src/item.rs b/crates/workspace/src/item.rs index c218a85234..4e24c831f4 100644 --- a/crates/workspace/src/item.rs +++ b/crates/workspace/src/item.rs @@ -171,6 +171,7 @@ pub trait Item: View { None } } + fn as_searchable(&self, _: &ViewHandle) -> Option> { None }