jon.recoil.org

Module Autocomplete.ContextSource

An instance of this is passed to completion source functions.

Sourcetype t

Completion context

include Jv.CONV with type t := Autocomplete.Context.t

to_jv reveals the JavaScript implementation.

of_jv hides the JavaScript implementation. Implementations usually do not guarantee type safety.

The editor state that the completion happens in.

The position at which the completion is happening.

Sourceval explicit : Autocomplete.Context.t -> bool

Indicates whether completion was activated explicitly, or implicitly by typing. The usual way to respond to this is to only return completions when either there is part of a completable entity before the cursor, or explicit is true.

Sourceval token_before : Autocomplete.Context.t -> string list -> Jv.t option

Get the extent, content, and (if there is a token) type of the token before this.pos.

Sourceval match_before : Autocomplete.Context.t -> RegExp.t -> Jv.t option

Get the match of the given expression directly before the cursor.

Sourceval aborted : Autocomplete.Context.t -> bool

Yields true when the query has been aborted. Can be useful in asynchronous queries to avoid doing work that will be ignored.