diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2025-03-26 05:49:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-26 05:49:48 -0700 |
commit | 8a7e1b19b9bf6cf3d081ca9d87bbe0045f93d556 (patch) | |
tree | 7fec31d6f4badb3e4c51fc09112e9ed757bd43a0 /runtime/lua/vim/lsp/completion.lua | |
parent | 6b00c9acfde954a3e992a2932eca9fa5902a1298 (diff) | |
download | rneovim-8a7e1b19b9bf6cf3d081ca9d87bbe0045f93d556.tar.gz rneovim-8a7e1b19b9bf6cf3d081ca9d87bbe0045f93d556.tar.bz2 rneovim-8a7e1b19b9bf6cf3d081ca9d87bbe0045f93d556.zip |
docs: news, lsp autocomplete #33047
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 |