Module TooltipSource

Sourcemodule Tooltip_view : sig ... end

Describes the way a tooltip is displayed.

Sourcemodule Tooltip : sig ... end

Creates a Tooltip:

Sourcetype hover_config
Sourceval hover_config : ?hide_on_change:bool -> ?hover_time:int -> unit -> hover_config

Options for hover tooltips:

  • parameter hover_on_change

    When enabled (this defaults to false), close the tooltip whenever the document changes.

  • parameter hover_time

    Hover time after which the tooltip should appear, in milliseconds. Defaults to 300ms.

Sourceval hover_tooltip : ?config:hover_config -> (view:Code_mirror.View.EditorView.t -> pos:int -> side:int -> Tooltip.t option Fut.t) -> Code_mirror.Extension.t

Enable a hover tooltip, which shows up when the pointer hovers over ranges of text. The callback is called when the mouse hovers over the document text. It should, if there is a tooltip associated with position pos return the tooltip description (either directly or in a promise). The side argument indicates on which side of the position the pointer isโ€”it will be -1 if the pointer is before the position, 1 if after the position.

Note that all hover tooltips are hosted within a single tooltip container element. This allows multiple tooltips over the same range to be "merged" together without overlapping.