diff options
Diffstat (limited to 'runtime/lua/vim/lsp/completion.lua')
-rw-r--r-- | runtime/lua/vim/lsp/completion.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua index 9345cb8d83..4f16d4173a 100644 --- a/runtime/lua/vim/lsp/completion.lua +++ b/runtime/lua/vim/lsp/completion.lua @@ -22,6 +22,14 @@ --- end, --- }) --- ``` +--- +--- [lsp-autocompletion]() +--- +--- The LSP `triggerCharacters` field decides when to trigger autocompletion. If you want to trigger +--- on EVERY keypress you can either: +--- - Extend `client.server_capabilities.completionProvider.triggerCharacters` on `LspAttach`, +--- before you call `vim.lsp.completion.enable(… {autotrigger=true})`. See the |lsp-attach| example. +--- - Call `vim.lsp.completion.get()` from the handler described at |compl-autocomplete|. local M = {} @@ -781,6 +789,9 @@ end --- Enables or disables completions from the given language client in the given buffer. --- Example: |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|. +--- --- @param enable boolean True to enable, false to disable --- @param client_id integer Client ID --- @param bufnr integer Buffer handle, or 0 for the current buffer |