Completion item object based off of LSP CompletionItem. Compared to the old kernel completions interface, this enhances the completions UI to support:

  • differentiation between inserted text and user facing text
  • documentation for each completion item to be displayed adjacently
  • deprecation styling
  • custom icons and other potential new features.
interface ICompletionItem {
    deprecated?: boolean;
    documentation?: string;
    icon?: LabIcon;
    insertText?: string;
    label: string;
    resolve?: ((patch?) => Promise<ICompletionItem>);
    type?: string;
}

Properties

deprecated?: boolean

Indicates if the item is deprecated.

documentation?: string

A human-readable string with additional information about this item, like type or symbol information.

icon?: LabIcon

LabIcon object for icon to be rendered with completion type.

insertText?: string

Completion to be inserted.

label: string

User facing completion. If insertText is not set, this will be inserted.

resolve?: ((patch?) => Promise<ICompletionItem>)

Method allowing to update fields asynchronously.

Type declaration

type?: string

Type of this completion item.