1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Hover — the [`Hover`] trait the app satisfies plus the plain data it
//! returns. Like the other language services it is **synchronous by contract**:
//! a hover query is an in-memory lookup keyed by the word under the pointer,
//! so the widget calls it on the mouse-idle tick and renders the reply the same
//! frame. Because the answer is produced synchronously there is no reply
//! envelope and nothing in flight, so a reply can never arrive stale.
use Range;
use crate::;
/// Mouse-idle delay before a hover query fires, in milliseconds. Tuned to the
/// ~300 ms mainstream editors use, so the popup feels neither jumpy nor
/// sluggish. The widget arms one query when the pointer rests over a word this
/// long without moving.
pub const HOVER_IDLE_DELAY_MS: u64 = 300;
/// The provider seam the integrating app implements to answer hover queries.
/// A revision-stamped hover request — everything the provider may read.
/// A resolved hover: the markdown to render and the word it describes.