diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-03-11 13:39:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-11 13:39:39 -0400 |
| commit | ba0baea620b16cb6ce4ecfcd7c5e69ebe478c276 (patch) | |
| tree | 2ba9a9f91a54786f6d7d4bfdbea448943e6c0d34 /runtime/lua/vim/lsp/completion.lua | |
| parent | 0ced2169279bc7d1d1dad906f9841707e336c371 (diff) | |
| parent | 682f5fee600802236e104ef85b5fbc6d3fe860cf (diff) | |
| download | rneovim-ba0baea620b16cb6ce4ecfcd7c5e69ebe478c276.tar.gz rneovim-ba0baea620b16cb6ce4ecfcd7c5e69ebe478c276.tar.bz2 rneovim-ba0baea620b16cb6ce4ecfcd7c5e69ebe478c276.zip | |
Merge #37830 docs
Diffstat (limited to 'runtime/lua/vim/lsp/completion.lua')
| -rw-r--r-- | runtime/lua/vim/lsp/completion.lua | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua index 4910c415d9..e495af4240 100644 --- a/runtime/lua/vim/lsp/completion.lua +++ b/runtime/lua/vim/lsp/completion.lua @@ -6,7 +6,7 @@ --- --- Example: activate LSP-driven auto-completion: --- ```lua ---- -- Works best with completeopt=noselect. +--- -- Works best if 'completeopt' has "noselect". --- -- Use CTRL-Y to select an item. |complete_CTRL-Y| --- vim.cmd[[set completeopt+=menuone,noselect,popup]] --- vim.lsp.start({ @@ -1159,15 +1159,14 @@ end --- Enables or disables completions from the given language client in the given --- buffer. Effects of enabling completions are: --- ---- - Calling |vim.lsp.completion.get()| uses the enabled clients to retrieve ---- completion candidates +--- - Calling |vim.lsp.completion.get()| uses the enabled clients to retrieve completion candidates. +--- - Selecting a completion item shows a preview popup ("completionItem/resolve") if 'completeopt' +--- has "popup". +--- - Accepting a completion item using `<c-y>` applies side effects like expanding snippets, +--- text edits (e.g. insert import statements) and executing associated commands. This works for +--- completions triggered via autotrigger, 'omnifunc' or [vim.lsp.completion.get()]. --- ---- - Accepting a completion candidate using `<c-y>` applies side effects like ---- expanding snippets, text edits (e.g. insert import statements) and ---- executing associated commands. This works for completions triggered via ---- autotrigger, omnifunc or completion.get() ---- ---- Example: |lsp-attach| |lsp-completion| +--- Examples: |lsp-attach| |lsp-completion| --- --- Note: the behavior of `autotrigger=true` is controlled by the LSP `triggerCharacters` field. You --- can override it on LspAttach, see |lsp-autocompletion|. |