Definition of completion providers.

Type: null or (attribute set of (attribute set of anything))

Default: null

Example:

{
  buffer = {
    score_offset = -7;
  };
  lsp = {
    fallbacks = [ ];
  };
}

Declared by:

Whether or not to enable the provider.

Type: null or boolean

Default: null

Example:

{
  __raw = ''
    function()
      return true
    end
  '';
}

Declared by:

Whether blink should wait for the source to return before showing the completions.

Type: null or boolean

Default: null

Declared by:

Warning: not yet implemented.

Type: null or anything

Default: null

Declared by:

If this provider returns 0 items, it will fallback to these providers.

Type: null or (list of string)

Default: null

Example:

[
  "buffer"
]

Declared by:

Maximum number of items to display in the menu.

Type: null or (unsigned integer, meaning >=0)

Default: null

Declared by:

Minimum number of characters in the keyword to trigger the provider.

Type: null or (unsigned integer, meaning >=0)

Default: null

Declared by:

The module name to load.

Type: null or string or raw lua code

Default: null

Example: "blink.cmp.sources.lsp"

Declared by:

The name of the source.

Type: null or string or raw lua code

Default: null

Example: "LSP"

Declared by:

Options for this provider.

Type: null or (attribute set of anything)

Default: null

Example: { }

Declared by:

Override source options.

Type: null or (attribute set of anything)

Default: null

Declared by:

Boost/penalize the score of the items.

Type: null or signed integer

Default: null

Example: 3

Declared by:

Whether or not to show the items.

Type: null or boolean

Default: null

Declared by:

How long to wait for the provider to return before showing completions and treating it as asynchronous.

Type: null or (unsigned integer, meaning >=0)

Default: null

Declared by:

Function to transform the items before they’re returned.

Type: null or raw lua code

Default: null

Example:

''
  function(_, items)
    -- demote snippets
    for _, item in ipairs(items) do
      if item.kind == require('blink.cmp.types').CompletionItemKind.Snippet then
        item.score_offset = item.score_offset - 3
      end
    end
  
    -- filter out text items, since we have the buffer source
    return vim.tbl_filter(
      function(item) return item.kind ~= require('blink.cmp.types').CompletionItemKind.Text end,
      items
    )
  end
''

Declared by: