diff --git a/crates/language_tools/src/lsp_log.rs b/crates/language_tools/src/lsp_log.rs index 62f9889a80..b956b7439d 100644 --- a/crates/language_tools/src/lsp_log.rs +++ b/crates/language_tools/src/lsp_log.rs @@ -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, + _: &'a App, + ) -> Option { + if type_id == TypeId::of::() { + Some(self_handle.to_any()) + } else if type_id == TypeId::of::() { + Some(self.editor.to_any()) + } else { + None + } + } + fn clone_on_split( &self, _workspace_id: Option,