Skip to content

Commit 11612f3

Browse files
committed
set hoverTime to 100ms
1 parent 5812e3a commit 11612f3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/CodeMirror.res

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,14 @@ module CM6 = {
178178
@module("@codemirror/view")
179179
external dropCursor: unit => extension = "dropCursor"
180180

181+
module HoverTooltipOptions = {
182+
type t = {hoverTime?: int, hideOnChange?: bool}
183+
}
181184
@module("@codemirror/view")
182-
external hoverTooltip: ((editorView, int, Side.t) => null<Tooltip.t>) => extension =
183-
"hoverTooltip"
185+
external hoverTooltip: (
186+
(editorView, int, Side.t) => null<Tooltip.t>,
187+
~options: HoverTooltipOptions.t=?,
188+
) => extension = "hoverTooltip"
184189

185190
module UpdateListener = {
186191
type update
@@ -604,7 +609,7 @@ let createLinterExtension = (errors: array<Error.t>): CM6.extension => {
604609
}
605610

606611
let createHoverHintExtension = (hoverHints: array<HoverHint.t>) => {
607-
CM6.EditorView.hoverTooltip((view, pos, _side) => {
612+
CM6.EditorView.hoverTooltip(~options={hoverTime: 100}, (view, pos, _side) => {
608613
let doc = view->CM6.EditorView.state->CM6.EditorState.doc
609614
let {number: line, from} = doc->CM6.Text.lineAt(pos)
610615
let col = pos - from

0 commit comments

Comments
 (0)