OptionalcommitSet a default set of commit characters for all options in this result.
OptionalfilterBy default, the library filters and scores completions. Set
filter to false to disable this, and cause your completions
to all be included, in the order they were given. When there are
other sources, unfiltered completions appear at the top of the
list of completions. validFor must not be given when filter
is false, because it only works when filtering.
The start of the range that is being completed.
OptionalgetWhen filter is set to
false or a completion has a
displayLabel, this
may be provided to compute the ranges on the label that match
the input. Should return an array of numbers where each pair of
adjacent numbers provide the start and end of a range. The
second argument, the match found by the library, is only passed
when filter isn't false.
OptionalmapWhen results contain position-dependent information in, for
example, apply methods, you can provide this method to update
the result for transactions that happen after the query. It is
not necessary to update from and to—those are tracked
automatically.
The completions returned. These don't have to be compared with
the input by the source—the autocompletion system will do its
own matching (against the text between from and to) and
sorting.
OptionaltoThe end of the range that is being completed. Defaults to the main cursor position.
OptionalupdateSynchronously update the completion result after typing or
deletion. If given, this should not do any expensive work, since
it will be called during editor state updates. The function
should make sure (similar to
validFor) that the
completion still applies in the new state.
OptionalvalidWhen given, further typing or deletion that causes the part of
the document between (mapped) from
and to to match this regular expression or predicate function
will not query the completion source again, but continue with
this list of options. This can help a lot with responsiveness,
since it allows the completion list to be updated synchronously.
Interface for objects returned by completion sources.