Skip to content

Commit c260a07

Browse files
chore(build): auto-generate docs
1 parent 602c800 commit c260a07

File tree

1 file changed

+0
-59
lines changed

1 file changed

+0
-59
lines changed

docs/extras/ai/copilot-native.md

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ Additional options for this extra can be configured in your [lua/config/options.
1414
```lua title="lua/config/options.lua"
1515
-- Native inline completions don't support being shown as regular completions
1616
vim.g.ai_cmp = false
17-
18-
-- Set to `true` in your `options.lua` to enable experimental support for Next Edit Suggestions
19-
vim.g.copilot_nes = false
2017
```
2118

2219
Below you can find a list of included plugins and their default settings.
@@ -74,36 +71,8 @@ opts = {
7471
copilot = function()
7572
vim.lsp.inline_completion.enable()
7673

77-
-- Only trigger NES updates:
78-
-- * when leaving insert mode
79-
-- * when text is changed (in normal mode)
80-
-- * when accepting a next edit suggestion
81-
local nes_update = Snacks.util.debounce(function()
82-
return vim.g.copilot_nes and require("copilot-lsp.nes").request_nes("copilot")
83-
end, { ms = 100 })
84-
85-
vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, {
86-
group = vim.api.nvim_create_augroup("lazyvim.copilot-native.complete", { clear = true }),
87-
callback = nes_update,
88-
})
89-
9074
-- Accept inline suggestions or next edits
9175
LazyVim.cmp.actions.ai_accept = function()
92-
if vim.b.nes_state then
93-
local nes = require("copilot-lsp.nes")
94-
95-
-- Try to jump to the start of the suggestion edit.
96-
if nes.walk_cursor_start_edit() then
97-
return true
98-
end
99-
100-
-- apply the pending suggestion and jump to the end of the edit.
101-
if nes.apply_pending_nes() then
102-
nes.walk_cursor_end_edit()
103-
nes_update() -- trigger new nes update after accept
104-
return true
105-
end
106-
end
10776
if vim.lsp.inline_completion.get() then
10877
-- nes_update() -- ensure nes update is triggered after inline completion
10978
return true
@@ -157,36 +126,8 @@ opts = {
157126
copilot = function()
158127
vim.lsp.inline_completion.enable()
159128

160-
-- Only trigger NES updates:
161-
-- * when leaving insert mode
162-
-- * when text is changed (in normal mode)
163-
-- * when accepting a next edit suggestion
164-
local nes_update = Snacks.util.debounce(function()
165-
return vim.g.copilot_nes and require("copilot-lsp.nes").request_nes("copilot")
166-
end, { ms = 100 })
167-
168-
vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, {
169-
group = vim.api.nvim_create_augroup("lazyvim.copilot-native.complete", { clear = true }),
170-
callback = nes_update,
171-
})
172-
173129
-- Accept inline suggestions or next edits
174130
LazyVim.cmp.actions.ai_accept = function()
175-
if vim.b.nes_state then
176-
local nes = require("copilot-lsp.nes")
177-
178-
-- Try to jump to the start of the suggestion edit.
179-
if nes.walk_cursor_start_edit() then
180-
return true
181-
end
182-
183-
-- apply the pending suggestion and jump to the end of the edit.
184-
if nes.apply_pending_nes() then
185-
nes.walk_cursor_end_edit()
186-
nes_update() -- trigger new nes update after accept
187-
return true
188-
end
189-
end
190131
if vim.lsp.inline_completion.get() then
191132
-- nes_update() -- ensure nes update is triggered after inline completion
192133
return true

0 commit comments

Comments
 (0)