OptionalapplyHow to apply the completion. The default is to replace it with
its label. When this holds a
string, the completion range is replaced by that string. When it
is a function, that function is called to perform the
completion. If it fires a transaction, it is responsible for
adding the pickedCompletion
annotation to it.
OptionalboostWhen given, should be a number from -99 to 99 that adjusts how this completion is ranked compared to other completions that match the input as well as this one. A negative number moves it down the list, a positive number moves it up.
OptionalcommitWhen this option is selected, and one of these characters is typed, insert the completion before typing the character.
OptionaldetailAn optional short piece of information to show (with a different style) after the label.
OptionaldisplayAn optional override for the completion's visible label. When
using this, matched characters will only be highlighted if you
provide a getMatch
function.
OptionalinfoAdditional info to show when the completion is selected. Can be a plain string or a function that'll render the DOM structure to show when invoked.
The label to show in the completion picker. This is what input is matched against to determine whether a completion matches (and how well it matches).
OptionalsectionCan be used to divide the completion list into sections.
Completions in a given section (matched by name) will be grouped
together, with a heading above them. Options without section
will appear above all sections. A string value is equivalent to
a {name} object.
OptionalsortOverrides the text that is used to sort completions. Will
default to label if not given.
OptionaltypeThe type of the completion. This is used to pick an icon to show
for the completion. Icons are styled with a CSS class created by
appending the type name to "cm-completionIcon-". You can
define or restyle icons by defining these selectors. The base
library defines simple icons for class, constant, enum,
function, interface, keyword, method, namespace,
property, text, type, and variable.
Multiple types can be provided by separating them with spaces.
Objects type used to represent individual completions.