Detailed changes
@@ -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);
@@ -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<Editor>) -> 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<HoverPopover>,
- pub hidden_at: Option<Instant>,
pub triggered_from: Option<Anchor>,
pub symbol_range: Option<Range<Anchor>>,
pub task: Option<Task<Option<()>>>,
@@ -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<Anchor>,
+ pub symbol_range: Option<Range<Anchor>>,
+ pub task: Option<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<Editor>,
) {
}
-
-#[derive(Default)]
-pub struct LinkGoToDefinitionState {
- pub triggered_from
- pub symbol_range: Option<Range<Anchor>>,
- pub task: Option<Task<Option<()>>>,
-}