···2233(** Most of this documention originate from the code-mirror reference.
4455- {{:https://codemirror.net/6/docs/ref/#autocomplete} Visit the
66- reference directly for additional information.} *)
55+ {{:https://codemirror.net/6/docs/ref/#autocomplete} Visit the reference
66+ directly for additional information.} *)
7788val autocomplete : Jv.t
99(** Global autocomplete value *)
···2929 t
3030 (** Creates a completion.
31313232- @param label The label to show in the completion picker.
3333- @param detail An optional short piece of information to show after the
3434- label.
3535- @param info Additional info to show when the completion is selected.
3636- @param apply (todo) How to apply the completion.
3737- @param type The type of the completion. This is used to pick an icon to
3838- show for the completion.
3939- @param boost
3232+ @param label The label to show in the completion picker.
3333+ @param detail
3434+ An optional short piece of information to show after the label.
3535+ @param info Additional info to show when the completion is selected.
3636+ @param apply (todo) How to apply the completion.
3737+ @param type
3838+ The type of the completion. This is used to pick an icon to show for the
3939+ completion.
4040+ @param boost
40414141- {{:https://codemirror.net/6/docs/ref/#autocomplete.Completion} See the
4242- reference for additional information.} *)
4242+ {{:https://codemirror.net/6/docs/ref/#autocomplete.Completion} See the
4343+ reference for additional information.} *)
4344end
44454546module Context : sig
···58595960 val explicit : t -> bool
6061 (** Indicates whether completion was activated explicitly, or implicitly by
6161- typing. The usual way to respond to this is to only return completions when
6262- either there is part of a completable entity before the cursor, or explicit
6363- is true. *)
6262+ typing. The usual way to respond to this is to only return completions
6363+ when either there is part of a completable entity before the cursor, or
6464+ explicit is true. *)
64656566 val token_before : t -> string list -> Jv.t option
6667 (** Get the extent, content, and (if there is a token) type of the token
6767- before this.pos. *)
6868+ before this.pos. *)
68696970 val match_before : t -> RegExp.t -> Jv.t option
7071 (** Get the match of the given expression directly before the cursor. *)
71727273 val aborted : t -> bool
7373- (** Yields true when the query has been aborted. Can be useful in
7474- asynchronous queries to avoid doing work that will be ignored. *)
7474+ (** Yields true when the query has been aborted. Can be useful in asynchronous
7575+ queries to avoid doing work that will be ignored. *)
7576end
76777778module Result : sig
···9091 ?filter:bool ->
9192 unit ->
9293 t
9393- (** Creating a new completion result (see {{: https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult} the docs}).
9494- @param from The start of the range that is being completed.
9595- @param to_ The end of the range that is being completed. Defaults to the
9696- main cursor position.
9797- @param options The completions returned.
9898- @param span When given, further input that causes the part of the document
9999- between [from] and [to_] to match this regular expression will not query
100100- the completion source again
101101- @param filter By default, the library filters and scores completions. Set
102102- filter to false to disable this, and cause your completions to all be
103103- included, in the order they were given.
104104- *)
9494+ (** Creating a new completion result (see
9595+ {{:https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult} the
9696+ docs}).
9797+ @param from The start of the range that is being completed.
9898+ @param to_
9999+ The end of the range that is being completed. Defaults to the main
100100+ cursor position.
101101+ @param options The completions returned.
102102+ @param span
103103+ When given, further input that causes the part of the document between
104104+ [from] and [to_] to match this regular expression will not query the
105105+ completion source again
106106+ @param filter
107107+ By default, the library filters and scores completions. Set filter to
108108+ false to disable this, and cause your completions to all be included, in
109109+ the order they were given. *)
105110end
106111107112module Source : sig
···114119115120 val from_list : Completion.t list -> t
116121 (** Given a a fixed array of options, return an autocompleter that completes
117117- them. *)
122122+ them. *)
118123end
119124120125type config
···130135 ?add_to_options:Jv.t ->
131136 unit ->
132137 config
133133-(** Configuration options for your autocompleter, see {{: https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config} the online docs}.*)
138138+(** Configuration options for your autocompleter, see
139139+ {{:https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config}
140140+ the online docs}.*)
134141135142val create : ?config:config -> unit -> Code_mirror.Extension.t
136143(** Autocompleter *)
+1-1
src/autocomplete/regExp.mli
···99(** Create a regular expression from a string. Internally this uses
1010 [new RegExp(s)] which
1111 {{:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp}
1212- has it's own documentation}. Note we pass noo flags at the moment. *)
1212+ has it's own documentation}. Note we pass noo flags at the moment. *)
13131414type result
1515(** The result of executing a regular expression search on a string *)
+2-1
src/lint/lint.mli
···991010 val create :
1111 name:string -> (view:Editor.View.t -> from:int -> to_:int -> unit) -> t
1212- (** [create ~name f] makes a new action with a function to call when the user activates the action *)
1212+ (** [create ~name f] makes a new action with a function to call when the user
1313+ activates the action *)
1314end
14151516module Diagnostic : sig
+45-39
src/tooltip/tooltip.mli
···2828 t
2929 (** Creates a TooltipView:
30303131- @param dom The DOM element to position over the editor.
3232- @param offset Adjust the position of the tooltip relative to its anchor
3333- position.
3434- @param get_coords This method can be provided to make the tooltip view
3535- itself responsible for finding its screen position.
3636- @param overlap By default, tooltips are moved when they overlap with other
3737- tooltips. Set this to true to disable that behavior for this tooltip.
3838- @param mount Called after the tooltip is added to the DOM for the first
3939- time.
4040- @param update Update the DOM element for a change in the view's state.
4141- @param positioned Called when the tooltip has been (re)positioned.
3131+ @param dom The DOM element to position over the editor.
3232+ @param offset
3333+ Adjust the position of the tooltip relative to its anchor position.
3434+ @param get_coords
3535+ This method can be provided to make the tooltip view itself responsible
3636+ for finding its screen position.
3737+ @param overlap
3838+ By default, tooltips are moved when they overlap with other tooltips.
3939+ Set this to true to disable that behavior for this tooltip.
4040+ @param mount
4141+ Called after the tooltip is added to the DOM for the first time.
4242+ @param update Update the DOM element for a change in the view's state.
4343+ @param positioned Called when the tooltip has been (re)positioned.
42444343- {{:https://codemirror.net/6/docs/ref/#tooltip.TooltipView} See the
4444- reference for additional information.} *)
4545+ {{:https://codemirror.net/6/docs/ref/#tooltip.TooltipView} See the
4646+ reference for additional information.} *)
4547end
46484749(** Creates a Tooltip:
48504949- @param pos The document position at which to show the tooltip.
5050- @param end The end of the range annotated by this tooltip, if different from
5151- pos.
5252- @param create A constructor function that creates the tooltip's DOM
5353- representation.
5454- @param above Whether the tooltip should be shown above or below the target
5555- position.
5656- @param strict_side Whether the above option should be honored when there
5757- isn't enough space on that side to show the tooltip inside the viewport.
5858- @param arrow When set to true, show a triangle connecting the tooltip element
5959- to position pos.
5151+ @param pos The document position at which to show the tooltip.
5252+ @param end
5353+ The end of the range annotated by this tooltip, if different from pos.
5454+ @param create
5555+ A constructor function that creates the tooltip's DOM representation.
5656+ @param above
5757+ Whether the tooltip should be shown above or below the target position.
5858+ @param strict_side
5959+ Whether the above option should be honored when there isn't enough space
6060+ on that side to show the tooltip inside the viewport.
6161+ @param arrow
6262+ When set to true, show a triangle connecting the tooltip element to
6363+ position pos.
60646161- {{:https://codemirror.net/6/docs/ref/#tooltip.Tooltip} See the
6262- reference for additional information.} *)
6565+ {{:https://codemirror.net/6/docs/ref/#tooltip.Tooltip} See the reference for
6666+ additional information.} *)
6367module Tooltip : sig
6468 (** Describes a tooltip. Values of this type, when provided through the
6565- show_tooltip facet, control the individual tooltips on the editor. *)
6969+ show_tooltip facet, control the individual tooltips on the editor. *)
66706771 type t
6872 (** Tooltip *)
···9296 ?hide_on_change:bool -> ?hover_time:int -> unit -> hover_config
9397(** Options for hover tooltips:
94989595- @param hover_on_change When enabled (this defaults to false), close the
9696- tooltip whenever the document changes.
9797-@param hover_time Hover time after which the tooltip should appear, in
9898-milliseconds. Defaults to 300ms. *)
9999+ @param hover_on_change
100100+ When enabled (this defaults to false), close the tooltip whenever the
101101+ document changes.
102102+ @param hover_time
103103+ Hover time after which the tooltip should appear, in milliseconds.
104104+ Defaults to 300ms. *)
99105100106val hover_tooltip :
101107 ?config:hover_config ->
102108 (view:Editor.View.t -> pos:int -> side:int -> Tooltip.t option Fut.t) ->
103109 Extension.t
104110(** Enable a hover tooltip, which shows up when the pointer hovers over ranges
105105- of text. The callback is called when the mouse hovers over the document text.
106106- It should, if there is a tooltip associated with position pos return the
107107- tooltip description (either directly or in a promise). The side argument
108108- indicates on which side of the position the pointer is—it will be -1 if the
109109- pointer is before the position, 1 if after the position.
111111+ of text. The callback is called when the mouse hovers over the document
112112+ text. It should, if there is a tooltip associated with position pos return
113113+ the tooltip description (either directly or in a promise). The side argument
114114+ indicates on which side of the position the pointer is—it will be -1 if the
115115+ pointer is before the position, 1 if after the position.
110116111111- Note that all hover tooltips are hosted within a single tooltip container
112112- element. This allows multiple tooltips over the same range to be "merged"
113113- together without overlapping. *)
117117+ Note that all hover tooltips are hosted within a single tooltip container
118118+ element. This allows multiple tooltips over the same range to be "merged"
119119+ together without overlapping. *)