Completion
Defined in: extensions/autocomplete/types.ts:28
Properties
Section titled “Properties”boost?
Section titled “boost?”
optionalboost:number
Defined in: extensions/autocomplete/types.ts:38
Can be used to adjust how the completion is ranked compared to other options. A positive number moves it up the list, while a negative one moves it down.
commitChars?
Section titled “commitChars?”
optionalcommitChars:string
Defined in: extensions/autocomplete/types.ts:98
If this option is selected and the user types a character present in this string, then the option is inserted right before the character is typed.
detail?
Section titled “detail?”
optionaldetail:string
Defined in: extensions/autocomplete/types.ts:40
Optional, short piece of information displayed after the label.
optionalicon:"function"|"constant"|"keyword"|"namespace"|"property"|string&object|"text"|"class"|"enum"|"event"|"interface"|"parameter"|"snippet"|"unit"|"variable"
Defined in: extensions/autocomplete/types.ts:57
Name of the icon shown before the label. This name is appended to the class
pce-ac-icon-, so i.e. .pce-ac-icon-variable can be used to style icons with the
name variable.
The icon element also gets it color set to the CSS variable --pce-ac-icon- followed
by the icon’s name. Use these CSS variables to set different colors for different
icons.
prism-code-editor/autocomplete-icons.css adds 14 icons from VSCode: class,
constant, enum, event, function, interface, keyword, namespace,
parameter, property, snippet, text, unit, and variable. You can import
your own icons instead.
Defaults to "variable"
insert?
Section titled “insert?”
optionalinsert:string
Defined in: extensions/autocomplete/types.ts:80
Text to insert when the completion is selected. Tabs are replaced with spaces when
options.insertSpaces isn’t set to false. The current indentation is preserved
when line feeds (\n) are found.
If omitted, the inserted text defaults to label.
label:
string
Defined in: extensions/autocomplete/types.ts:33
Label of the option. The label is displayed in the option and used to filter and sort options. By default, this is the text inserted when the option is selected.
tabStops?
Section titled “tabStops?”
optionaltabStops:number[]
Defined in: extensions/autocomplete/types.ts:93
Array of ranges. Each even index defines the start of a range. The subsequent index defines the end of that range. The ranges are relative to the start of the inserted text. The first range is selected initially.
If there are multiple ranges, the Tab key can be used to select the next tab stop. Once the final tab stop is selected or Escape is pressed, the tab stops disappear.
The ranges must not overlap.
If the last range only contains one number, the second defaults to the first.
Methods
Section titled “Methods”renderDocs()?
Section titled “renderDocs()?”
optionalrenderDocs(item,context,editor): (string|Node)[]
Defined in: extensions/autocomplete/types.ts:107
Optional function to render the contents of an additional tooltip documenting the completion item.
Parameters
Section titled “Parameters”Completion
Completion item to render documentation for.
context
Section titled “context”Current completion context.
editor
Section titled “editor”Current editor.
Returns
Section titled “Returns”(string | Node)[]
List of nodes to show in the tooltip.