docs: news, lsp autocomplete #33047

This commit is contained in:
Justin M. Keyes
2025-03-26 05:49:48 -07:00
committed by GitHub
parent 6b00c9acfd
commit 8a7e1b19b9
9 changed files with 51 additions and 56 deletions

View File

@@ -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