aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lsp/copilot.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/lsp/copilot.lua b/lsp/copilot.lua
index 5f216d53..66c2dd54 100644
--- a/lsp/copilot.lua
+++ b/lsp/copilot.lua
@@ -13,6 +13,33 @@
---
--- Please see [terms of use for GitHub Copilot](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features#github-copilot)
---
+--- You need to enable `:help lsp-inline-completion` to receive suggestions. For example, you can enable it in the LspAttach event:
+---
+--- ```lua
+--- vim.api.nvim_create_autocmd('LspAttach', {
+--- callback = function(args)
+--- local bufnr = args.buf
+--- local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
+---
+--- if client:supports_method(vim.lsp.protocol.Methods.textDocument_inlineCompletion, bufnr) then
+--- vim.lsp.inline_completion.enable(true, { bufnr = bufnr })
+---
+--- vim.keymap.set(
+--- 'i',
+--- '<C-F>',
+--- vim.lsp.inline_completion.get,
+--- { desc = 'LSP: accept inline completion', buffer = bufnr }
+--- )
+--- vim.keymap.set(
+--- 'i',
+--- '<C-G>',
+--- vim.lsp.inline_completion.select,
+--- { desc = 'LSP: switch inline completion', buffer = bufnr }
+--- )
+--- end
+--- end
+--- })
+--- ```
---@param bufnr integer,
---@param client vim.lsp.Client