Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddu_vim/deps.ts>fn.complete_info

Dark deno-powered UI framework for neovim/Vim
Go to Latest
function fn.complete_info
import { fn } from "https://deno.land/x/ddu_vim@v4.0.0/deps.ts";
const { complete_info } = fn;

Returns a Dictionary with information about Insert mode completion. See ins-completion. The items are: mode Current completion mode name string. See complete_info_mode for the values. pum_visible TRUE if popup menu is visible. See pumvisible(). items List of completion matches. Each item is a dictionary containing the entries "word", "abbr", "menu", "kind", "info" and "user_data". See complete-items. selected Selected item index. First index is zero. Index is -1 if no item is selected (showing typed text only, or the last completion after no item is selected when using the <Up> or <Down> keys) inserted Inserted string. [NOT IMPLEMENTED YET]

mode values are: "" Not in completion mode "keyword" Keyword completion i_CTRL-X_CTRL-N "ctrl_x" Just pressed CTRL-X i_CTRL-X "scroll" Scrolling with i_CTRL-X_CTRL-E or i_CTRL-X_CTRL-Y "whole_line" Whole lines i_CTRL-X_CTRL-L "files" File names i_CTRL-X_CTRL-F "tags" Tags i_CTRL-X_CTRL-] "path_defines" Definition completion i_CTRL-X_CTRL-D "path_patterns" Include completion i_CTRL-X_CTRL-I "dictionary" Dictionary i_CTRL-X_CTRL-K "thesaurus" Thesaurus i_CTRL-X_CTRL-T "cmdline" Vim Command line i_CTRL-X_CTRL-V "function" User defined completion i_CTRL-X_CTRL-U "omni" Omni completion i_CTRL-X_CTRL-O "spell" Spelling suggestions i_CTRL-X_s "eval" complete() completion "unknown" Other internal modes

If the optional {what} list argument is supplied, then only the items listed in {what} are returned. Unsupported items in {what} are silently ignored.

To get the position and size of the popup menu, see pum_getpos(). It's also available in v:event during the CompleteChanged event.

Returns an empty Dictionary on error.

Examples:

" Get all items
call complete_info()
" Get only 'mode'
call complete_info(['mode'])
" Get only 'mode' and 'pum_visible'
call complete_info(['mode', 'pum_visible'])

Can also be used as a method:

GetItems()->complete_info()

Parameters

denops: Denops
optional
what: unknown

Returns

Promise<Record<string, unknown>>