mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-06 10:20:16 +03:00
Make channel notes act as an editor to enable inline assistant
This commit is contained in:
parent
e7b7ac9d8c
commit
4e818fed4a
@ -15,7 +15,7 @@ use gpui::{
|
|||||||
ViewContext, ViewHandle,
|
ViewContext, ViewHandle,
|
||||||
};
|
};
|
||||||
use project::Project;
|
use project::Project;
|
||||||
use std::any::Any;
|
use std::any::{Any, TypeId};
|
||||||
use workspace::{
|
use workspace::{
|
||||||
item::{FollowableItem, Item, ItemHandle},
|
item::{FollowableItem, Item, ItemHandle},
|
||||||
register_followable_item,
|
register_followable_item,
|
||||||
@ -189,6 +189,21 @@ impl View for ChannelView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Item for ChannelView {
|
impl Item for ChannelView {
|
||||||
|
fn act_as_type<'a>(
|
||||||
|
&'a self,
|
||||||
|
type_id: TypeId,
|
||||||
|
self_handle: &'a ViewHandle<Self>,
|
||||||
|
_: &'a AppContext,
|
||||||
|
) -> Option<&'a AnyViewHandle> {
|
||||||
|
if type_id == TypeId::of::<Self>() {
|
||||||
|
Some(self_handle)
|
||||||
|
} else if type_id == TypeId::of::<Editor>() {
|
||||||
|
Some(&self.editor)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn tab_content<V: 'static>(
|
fn tab_content<V: 'static>(
|
||||||
&self,
|
&self,
|
||||||
_: Option<usize>,
|
_: Option<usize>,
|
||||||
|
@ -171,6 +171,7 @@ pub trait Item: View {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_searchable(&self, _: &ViewHandle<Self>) -> Option<Box<dyn SearchableItemHandle>> {
|
fn as_searchable(&self, _: &ViewHandle<Self>) -> Option<Box<dyn SearchableItemHandle>> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user