Skip to content

Completion

Defined in: extensions/autocomplete/types.ts:3

optional boost: number

Defined in: extensions/autocomplete/types.ts:13

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.


optional commitChars: string

Defined in: extensions/autocomplete/types.ts:73

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.


optional detail: string

Defined in: extensions/autocomplete/types.ts:15

Optional, short piece of information displayed after the label.


optional icon: "function" | "constant" | "keyword" | "namespace" | "property" | string & object | "text" | "class" | "enum" | "event" | "interface" | "parameter" | "snippet" | "unit" | "variable"

Defined in: extensions/autocomplete/types.ts:32

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"


optional insert: string

Defined in: extensions/autocomplete/types.ts:55

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:8

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.


optional tabStops: number[]

Defined in: extensions/autocomplete/types.ts:68

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.