@@ -3,8 +3,8 @@ use copilot::Copilot;
use editor::{actions::MoveToEnd, scroll::Autoscroll, Editor, EditorEvent};
use futures::{channel::mpsc, StreamExt};
use gpui::{
- actions, div, App, Context, Corner, Entity, EventEmitter, FocusHandle, Focusable, IntoElement,
- ParentElement, Render, Styled, Subscription, WeakEntity, Window,
+ actions, div, AnyView, App, Context, Corner, Entity, EventEmitter, FocusHandle, Focusable,
+ IntoElement, ParentElement, Render, Styled, Subscription, WeakEntity, Window,
};
use language::{language_settings::SoftWrap, LanguageServerId};
use lsp::{
@@ -12,7 +12,7 @@ use lsp::{
SetTraceParams, TraceValue,
};
use project::{search::SearchQuery, Project, WorktreeId};
-use std::{borrow::Cow, sync::Arc};
+use std::{any::TypeId, borrow::Cow, sync::Arc};
use ui::{prelude::*, Button, Checkbox, ContextMenu, Label, PopoverMenu, ToggleState};
use workspace::{
item::{Item, ItemHandle},
@@ -1071,6 +1071,21 @@ impl Item for LspLogView {
Some(Box::new(handle.clone()))
}
+ fn act_as_type<'a>(
+ &'a self,
+ type_id: TypeId,
+ self_handle: &'a Entity<Self>,
+ _: &'a App,
+ ) -> Option<AnyView> {
+ if type_id == TypeId::of::<Self>() {
+ Some(self_handle.to_any())
+ } else if type_id == TypeId::of::<Editor>() {
+ Some(self.editor.to_any())
+ } else {
+ None
+ }
+ }
+
fn clone_on_split(
&self,
_workspace_id: Option<WorkspaceId>,