Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Use editor's overlay implementation
Conrad Irwin82f6f771172e
diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rsindex a15d18f0308..c713ab085b7 100644--- a/crates/editor2/src/editor.rs+++ b/crates/editor2/src/editor.rs@@ -39,13 +39,12 @@ use futures::FutureExt;use fuzzy::{StringMatch, StringMatchCandidate};use git::diff_hunk_to_display;use gpui::{- actions, div, overlay, point, prelude::*, px, relative, rems, size, uniform_list, Action,- AnyElement, AppContext, AsyncWindowContext, BackgroundExecutor, Bounds, ClipboardItem, Context,- ElementId, EventEmitter, FocusHandle, FocusableView, FontFeatures, FontStyle, FontWeight,- HighlightStyle, Hsla, InputHandler, InteractiveText, KeyContext, Model, MouseButton,- ParentElement, Pixels, Render, RenderOnce, SharedString, Styled, StyledText, Subscription,- Task, TextRun, TextStyle, UniformListScrollHandle, View, ViewContext, VisualContext, WeakView,- WhiteSpace, WindowContext,+ actions, div, point, prelude::*, px, relative, rems, size, uniform_list, Action, AnyElement,+ AppContext, AsyncWindowContext, BackgroundExecutor, Bounds, ClipboardItem, Context, ElementId,+ EventEmitter, FocusHandle, FocusableView, FontFeatures, FontStyle, FontWeight, HighlightStyle,+ Hsla, InputHandler, InteractiveText, KeyContext, Model, MouseButton, ParentElement, Pixels,+ Render, RenderOnce, SharedString, Styled, StyledText, Subscription, Task, TextRun, TextStyle,+ UniformListScrollHandle, View, ViewContext, VisualContext, WeakView, WhiteSpace, WindowContext,};use highlight_matching_bracket::refresh_matching_bracket_highlights;use hover_popover::{hide_hover, HoverState};@@ -1369,23 +1368,11 @@ impl CompletionsMenu {.track_scroll(self.scroll_handle.clone()).with_width_from_item(widest_completion_ix);- // Old:- // Popover::new()- // .child(list)- // .when_some(multiline_docs, |popover, multiline_docs| {- // popover.aside(multiline_docs)- // })- // .into_any_element()-- overlay()- .anchor(gpui::AnchorCorner::TopLeft)- .child(- Popover::new()- .child(list)- .when_some(multiline_docs, |popover, multiline_docs| {- popover.aside(multiline_docs)- }),- )+ Popover::new()+ .child(list)+ .when_some(multiline_docs, |popover, multiline_docs| {+ popover.aside(multiline_docs)+ }).into_any_element()}diff --git a/crates/ui2/src/components/popover.rs b/crates/ui2/src/components/popover.rsindex 925fb30a5e8..3838e40bec5 100644--- a/crates/ui2/src/components/popover.rs+++ b/crates/ui2/src/components/popover.rs@@ -1,11 +1,11 @@use gpui::{- div, AnyElement, Div, Element, ElementId, IntoElement, ParentElement, RenderOnce, Styled,+ AnyElement, Div, Element, ElementId, IntoElement, ParentElement, RenderOnce, Styled,WindowContext,};use smallvec::SmallVec;use theme2::ActiveTheme;-use crate::{h_stack, v_stack, StyledExt};+use crate::{v_stack, StyledExt};/// A popover is used to display a menu or show some options.///