···23(** Most of this documention originate from the code-mirror reference.
45- {{:https://codemirror.net/6/docs/ref/#autocomplete} Visit the
6- reference directly for additional information.} *)
78val autocomplete : Jv.t
9(** Global autocomplete value *)
···29 t
30 (** Creates a completion.
3132- @param label The label to show in the completion picker.
33- @param detail An optional short piece of information to show after the
34- label.
35- @param info Additional info to show when the completion is selected.
36- @param apply (todo) How to apply the completion.
37- @param type The type of the completion. This is used to pick an icon to
38- show for the completion.
39- @param boost
04041- {{:https://codemirror.net/6/docs/ref/#autocomplete.Completion} See the
42- reference for additional information.} *)
43end
4445module Context : sig
···5859 val explicit : t -> bool
60 (** Indicates whether completion was activated explicitly, or implicitly by
61- typing. The usual way to respond to this is to only return completions when
62- either there is part of a completable entity before the cursor, or explicit
63- is true. *)
6465 val token_before : t -> string list -> Jv.t option
66 (** Get the extent, content, and (if there is a token) type of the token
67- before this.pos. *)
6869 val match_before : t -> RegExp.t -> Jv.t option
70 (** Get the match of the given expression directly before the cursor. *)
7172 val aborted : t -> bool
73- (** Yields true when the query has been aborted. Can be useful in
74- asynchronous queries to avoid doing work that will be ignored. *)
75end
7677module Result : sig
···90 ?filter:bool ->
91 unit ->
92 t
93- (** Creating a new completion result (see {{: https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult} the docs}).
94- @param from The start of the range that is being completed.
95- @param to_ The end of the range that is being completed. Defaults to the
96- main cursor position.
97- @param options The completions returned.
98- @param span When given, further input that causes the part of the document
99- between [from] and [to_] to match this regular expression will not query
100- the completion source again
101- @param filter By default, the library filters and scores completions. Set
102- filter to false to disable this, and cause your completions to all be
103- included, in the order they were given.
104- *)
0000105end
106107module Source : sig
···114115 val from_list : Completion.t list -> t
116 (** Given a a fixed array of options, return an autocompleter that completes
117- them. *)
118end
119120type config
···130 ?add_to_options:Jv.t ->
131 unit ->
132 config
133-(** Configuration options for your autocompleter, see {{: https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config} the online docs}.*)
00134135val create : ?config:config -> unit -> Code_mirror.Extension.t
136(** Autocompleter *)
···23(** Most of this documention originate from the code-mirror reference.
45+ {{:https://codemirror.net/6/docs/ref/#autocomplete} Visit the reference
6+ directly for additional information.} *)
78val autocomplete : Jv.t
9(** Global autocomplete value *)
···29 t
30 (** Creates a completion.
3132+ @param label The label to show in the completion picker.
33+ @param detail
34+ An optional short piece of information to show after the label.
35+ @param info Additional info to show when the completion is selected.
36+ @param apply (todo) How to apply the completion.
37+ @param type
38+ The type of the completion. This is used to pick an icon to show for the
39+ completion.
40+ @param boost
4142+ {{:https://codemirror.net/6/docs/ref/#autocomplete.Completion} See the
43+ reference for additional information.} *)
44end
4546module Context : sig
···5960 val explicit : t -> bool
61 (** Indicates whether completion was activated explicitly, or implicitly by
62+ typing. The usual way to respond to this is to only return completions
63+ when either there is part of a completable entity before the cursor, or
64+ explicit is true. *)
6566 val token_before : t -> string list -> Jv.t option
67 (** Get the extent, content, and (if there is a token) type of the token
68+ before this.pos. *)
6970 val match_before : t -> RegExp.t -> Jv.t option
71 (** Get the match of the given expression directly before the cursor. *)
7273 val aborted : t -> bool
74+ (** Yields true when the query has been aborted. Can be useful in asynchronous
75+ queries to avoid doing work that will be ignored. *)
76end
7778module Result : sig
···91 ?filter:bool ->
92 unit ->
93 t
94+ (** Creating a new completion result (see
95+ {{:https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult} the
96+ docs}).
97+ @param from The start of the range that is being completed.
98+ @param to_
99+ The end of the range that is being completed. Defaults to the main
100+ cursor position.
101+ @param options The completions returned.
102+ @param span
103+ When given, further input that causes the part of the document between
104+ [from] and [to_] to match this regular expression will not query the
105+ completion source again
106+ @param filter
107+ By default, the library filters and scores completions. Set filter to
108+ false to disable this, and cause your completions to all be included, in
109+ the order they were given. *)
110end
111112module Source : sig
···119120 val from_list : Completion.t list -> t
121 (** Given a a fixed array of options, return an autocompleter that completes
122+ them. *)
123end
124125type config
···135 ?add_to_options:Jv.t ->
136 unit ->
137 config
138+(** Configuration options for your autocompleter, see
139+ {{:https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config}
140+ the online docs}.*)
141142val create : ?config:config -> unit -> Code_mirror.Extension.t
143(** Autocompleter *)
+1-1
src/autocomplete/regExp.mli
···9(** Create a regular expression from a string. Internally this uses
10 [new RegExp(s)] which
11 {{:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp}
12- has it's own documentation}. Note we pass noo flags at the moment. *)
1314type result
15(** The result of executing a regular expression search on a string *)
···9(** Create a regular expression from a string. Internally this uses
10 [new RegExp(s)] which
11 {{:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp}
12+ has it's own documentation}. Note we pass noo flags at the moment. *)
1314type result
15(** The result of executing a regular expression search on a string *)
+2-1
src/lint/lint.mli
···910 val create :
11 name:string -> (view:Editor.View.t -> from:int -> to_:int -> unit) -> t
12- (** [create ~name f] makes a new action with a function to call when the user activates the action *)
013end
1415module Diagnostic : sig
···910 val create :
11 name:string -> (view:Editor.View.t -> from:int -> to_:int -> unit) -> t
12+ (** [create ~name f] makes a new action with a function to call when the user
13+ activates the action *)
14end
1516module Diagnostic : sig
+45-39
src/tooltip/tooltip.mli
···28 t
29 (** Creates a TooltipView:
3031- @param dom The DOM element to position over the editor.
32- @param offset Adjust the position of the tooltip relative to its anchor
33- position.
34- @param get_coords This method can be provided to make the tooltip view
35- itself responsible for finding its screen position.
36- @param overlap By default, tooltips are moved when they overlap with other
37- tooltips. Set this to true to disable that behavior for this tooltip.
38- @param mount Called after the tooltip is added to the DOM for the first
39- time.
40- @param update Update the DOM element for a change in the view's state.
41- @param positioned Called when the tooltip has been (re)positioned.
004243- {{:https://codemirror.net/6/docs/ref/#tooltip.TooltipView} See the
44- reference for additional information.} *)
45end
4647(** Creates a Tooltip:
4849- @param pos The document position at which to show the tooltip.
50- @param end The end of the range annotated by this tooltip, if different from
51- pos.
52- @param create A constructor function that creates the tooltip's DOM
53- representation.
54- @param above Whether the tooltip should be shown above or below the target
55- position.
56- @param strict_side Whether the above option should be honored when there
57- isn't enough space on that side to show the tooltip inside the viewport.
58- @param arrow When set to true, show a triangle connecting the tooltip element
59- to position pos.
006061- {{:https://codemirror.net/6/docs/ref/#tooltip.Tooltip} See the
62- reference for additional information.} *)
63module Tooltip : sig
64 (** Describes a tooltip. Values of this type, when provided through the
65- show_tooltip facet, control the individual tooltips on the editor. *)
6667 type t
68 (** Tooltip *)
···92 ?hide_on_change:bool -> ?hover_time:int -> unit -> hover_config
93(** Options for hover tooltips:
9495- @param hover_on_change When enabled (this defaults to false), close the
96- tooltip whenever the document changes.
97-@param hover_time Hover time after which the tooltip should appear, in
98-milliseconds. Defaults to 300ms. *)
0099100val hover_tooltip :
101 ?config:hover_config ->
102 (view:Editor.View.t -> pos:int -> side:int -> Tooltip.t option Fut.t) ->
103 Extension.t
104(** Enable a hover tooltip, which shows up when the pointer hovers over ranges
105- of text. The callback is called when the mouse hovers over the document text.
106- It should, if there is a tooltip associated with position pos return the
107- tooltip description (either directly or in a promise). The side argument
108- indicates on which side of the position the pointer is—it will be -1 if the
109- pointer is before the position, 1 if after the position.
110111- Note that all hover tooltips are hosted within a single tooltip container
112- element. This allows multiple tooltips over the same range to be "merged"
113- together without overlapping. *)
···28 t
29 (** Creates a TooltipView:
3031+ @param dom The DOM element to position over the editor.
32+ @param offset
33+ Adjust the position of the tooltip relative to its anchor position.
34+ @param get_coords
35+ This method can be provided to make the tooltip view itself responsible
36+ for finding its screen position.
37+ @param overlap
38+ By default, tooltips are moved when they overlap with other tooltips.
39+ Set this to true to disable that behavior for this tooltip.
40+ @param mount
41+ Called after the tooltip is added to the DOM for the first time.
42+ @param update Update the DOM element for a change in the view's state.
43+ @param positioned Called when the tooltip has been (re)positioned.
4445+ {{:https://codemirror.net/6/docs/ref/#tooltip.TooltipView} See the
46+ reference for additional information.} *)
47end
4849(** Creates a Tooltip:
5051+ @param pos The document position at which to show the tooltip.
52+ @param end
53+ The end of the range annotated by this tooltip, if different from pos.
54+ @param create
55+ A constructor function that creates the tooltip's DOM representation.
56+ @param above
57+ Whether the tooltip should be shown above or below the target position.
58+ @param strict_side
59+ Whether the above option should be honored when there isn't enough space
60+ on that side to show the tooltip inside the viewport.
61+ @param arrow
62+ When set to true, show a triangle connecting the tooltip element to
63+ position pos.
6465+ {{:https://codemirror.net/6/docs/ref/#tooltip.Tooltip} See the reference for
66+ additional information.} *)
67module Tooltip : sig
68 (** Describes a tooltip. Values of this type, when provided through the
69+ show_tooltip facet, control the individual tooltips on the editor. *)
7071 type t
72 (** Tooltip *)
···96 ?hide_on_change:bool -> ?hover_time:int -> unit -> hover_config
97(** Options for hover tooltips:
9899+ @param hover_on_change
100+ When enabled (this defaults to false), close the tooltip whenever the
101+ document changes.
102+ @param hover_time
103+ Hover time after which the tooltip should appear, in milliseconds.
104+ Defaults to 300ms. *)
105106val hover_tooltip :
107 ?config:hover_config ->
108 (view:Editor.View.t -> pos:int -> side:int -> Tooltip.t option Fut.t) ->
109 Extension.t
110(** Enable a hover tooltip, which shows up when the pointer hovers over ranges
111+ of text. The callback is called when the mouse hovers over the document
112+ text. It should, if there is a tooltip associated with position pos return
113+ the tooltip description (either directly or in a promise). The side argument
114+ indicates on which side of the position the pointer is—it will be -1 if the
115+ pointer is before the position, 1 if after the position.
116117+ Note that all hover tooltips are hosted within a single tooltip container
118+ element. This allows multiple tooltips over the same range to be "merged"
119+ together without overlapping. *)