Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Method renaming intended to be included in #29551 (#29553)
Michael Sloanb41ffae1610f
diff --git a/crates/agent/src/ui/context_pill.rs b/crates/agent/src/ui/context_pill.rsindex d7483cb2c67..e0be906c7f0 100644--- a/crates/agent/src/ui/context_pill.rs+++ b/crates/agent/src/ui/context_pill.rs@@ -491,7 +491,7 @@ impl AddedContext {let thread = handle.thread.clone();Some(Rc::new(move |_, cx| {let text = thread.read(cx).latest_detailed_summary_or_text();- text_hover_view(text.clone(), cx).into()+ ContextPillHover::new_text(text.clone(), cx).into()}))},handle: AgentContextHandle::Thread(handle),@@ -509,7 +509,7 @@ impl AddedContext {render_hover: {let text = context.text.clone();Some(Rc::new(move |_, cx| {- text_hover_view(text.clone(), cx).into()+ ContextPillHover::new_text(text.clone(), cx).into()}))},handle: AgentContextHandle::Thread(context.handle.clone()),@@ -554,7 +554,7 @@ impl AddedContext {render_hover: {let text = context.text.clone();Some(Rc::new(move |_, cx| {- text_hover_view(text.clone(), cx).into()+ ContextPillHover::new_text(text.clone(), cx).into()}))},handle: AgentContextHandle::Rules(context.handle.clone()),@@ -670,18 +670,6 @@ impl ContextFileExcerpt {}}-fn text_hover_view(content: SharedString, cx: &mut App) -> Entity<ContextPillHover> {- ContextPillHover::new(cx, move |_, _| {- div()- .id("context-pill-hover-contents")- .overflow_scroll()- .max_w_128()- .max_h_96()- .child(content.clone())- .into_any_element()- })-}-struct ContextPillHover {render_hover: Box<dyn Fn(&mut Window, &mut App) -> AnyElement>,}@@ -695,6 +683,18 @@ impl ContextPillHover {render_hover: Box::new(render_hover),})}++ fn new_text(content: SharedString, cx: &mut App) -> Entity<Self> {+ Self::new(cx, move |_, _| {+ div()+ .id("context-pill-hover-contents")+ .overflow_scroll()+ .max_w_128()+ .max_h_96()+ .child(content.clone())+ .into_any_element()+ })+ }}impl Render for ContextPillHover {