mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
docs(lsp): completion.enable #33063
This commit is contained in:
committed by
GitHub
parent
8a7e1b19b9
commit
6566b66f65
@ -1900,7 +1900,15 @@ you want to trigger on EVERY keypress you can either:
|
||||
*vim.lsp.completion.enable()*
|
||||
enable({enable}, {client_id}, {bufnr}, {opts})
|
||||
Enables or disables completions from the given language client in the
|
||||
given buffer. Example: |lsp-attach| |lsp-completion|
|
||||
given buffer. Effects of enabling completions are:
|
||||
• Calling |vim.lsp.completion.get()| uses the enabled clients to retrieve
|
||||
completion candidates
|
||||
• 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|
|
||||
|
||||
Note: the behavior of `autotrigger=true` is controlled by the LSP
|
||||
`triggerCharacters` field. You can override it on LspAttach, see
|
||||
|
@ -786,7 +786,17 @@ local function disable_completions(client_id, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
--- Enables or disables completions from the given language client in the given buffer.
|
||||
--- 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
|
||||
---
|
||||
--- - 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|
|
||||
---
|
||||
--- Note: the behavior of `autotrigger=true` is controlled by the LSP `triggerCharacters` field. You
|
||||
|
Reference in New Issue
Block a user