diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 51ec4efcf8..6d384e1d57 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -38,6 +38,7 @@ use language::{ IndentKind, IndentSize, Language, OffsetRangeExt, Point, Selection, SelectionGoal, TransactionId, }; +use link_go_to_definition::LinkGoToDefinitionState; use multi_buffer::MultiBufferChunks; pub use multi_buffer::{ Anchor, AnchorRangeExt, ExcerptId, ExcerptRange, MultiBuffer, MultiBufferSnapshot, ToOffset, @@ -1023,6 +1024,7 @@ impl Editor { input_enabled: true, leader_replica_id: None, hover_state: Default::default(), + link_go_to_definition_state: Default::default(), }; this.end_selection(cx); diff --git a/crates/editor/src/hover_popover.rs b/crates/editor/src/hover_popover.rs index 28a8be1399..a0acc908df 100644 --- a/crates/editor/src/hover_popover.rs +++ b/crates/editor/src/hover_popover.rs @@ -1,7 +1,4 @@ -use std::{ - ops::Range, - time::{Duration, Instant}, -}; +use std::{ops::Range, time::Duration}; use gpui::{ actions, @@ -60,7 +57,6 @@ pub fn hide_hover(editor: &mut Editor, cx: &mut ViewContext) -> bool { // only notify the context once if editor.hover_state.popover.is_some() { editor.hover_state.popover = None; - editor.hover_state.hidden_at = Some(cx.background().now()); did_hide = true; cx.notify(); } @@ -242,7 +238,6 @@ fn show_hover( #[derive(Default)] pub struct HoverState { pub popover: Option, - pub hidden_at: Option, pub triggered_from: Option, pub symbol_range: Option>, pub task: Option>>, diff --git a/crates/editor/src/link_go_to_definition.rs b/crates/editor/src/link_go_to_definition.rs index 412181c9bb..42dece7185 100644 --- a/crates/editor/src/link_go_to_definition.rs +++ b/crates/editor/src/link_go_to_definition.rs @@ -36,6 +36,13 @@ pub fn init(cx: &mut MutableAppContext) { cx.add_action(go_to_fetched_definition); } +#[derive(Default)] +pub struct LinkGoToDefinitionState { + pub triggered_from: Option, + pub symbol_range: Option>, + pub task: Option>>, +} + pub fn fetch_definition( editor: &mut Editor, FetchDefinition { point }: &FetchDefinition, @@ -49,10 +56,3 @@ pub fn go_to_fetched_definition( cx: &mut ViewContext, ) { } - -#[derive(Default)] -pub struct LinkGoToDefinitionState { - pub triggered_from - pub symbol_range: Option>, - pub task: Option>>, -} \ No newline at end of file