Skip to content

Commit 305a2db

Browse files
chore(build): auto-generate docs
1 parent c260a07 commit 305a2db

File tree

5 files changed

+83
-37
lines changed

5 files changed

+83
-37
lines changed

docs/configuration/general.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
241241
map({ "i", "n", "s" }, "<esc>", function()
242242
vim.cmd("noh")
243243
LazyVim.cmp.actions.snippet_stop()
244-
LazyVim.cmp.actions.ai_stop()
245244
return "<esc>"
246245
end, { expr = true, desc = "Escape and Clear hlsearch" })
247246

docs/extras/ai/copilot-native.md

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,6 @@ import TabItem from '@theme/TabItem';
3939
opts = {
4040
servers = {
4141
copilot = {
42-
handlers = {
43-
didChangeStatus = function(err, res, ctx)
44-
if err then
45-
return
46-
end
47-
status[ctx.client_id] = res.kind ~= "Normal" and "error" or res.busy and "pending" or "ok"
48-
if res.status == "Error" then
49-
LazyVim.error("Please use `:LspCopilotSignIn` to sign in to Copilot")
50-
end
51-
end,
52-
},
5342
-- stylua: ignore
5443
keys = {
5544
{
@@ -70,13 +59,25 @@ opts = {
7059
setup = {
7160
copilot = function()
7261
vim.lsp.inline_completion.enable()
73-
7462
-- Accept inline suggestions or next edits
7563
LazyVim.cmp.actions.ai_accept = function()
76-
if vim.lsp.inline_completion.get() then
77-
-- nes_update() -- ensure nes update is triggered after inline completion
78-
return true
79-
end
64+
return vim.lsp.inline_completion.get()
65+
end
66+
67+
if not LazyVim.has_extra("ai.sidekick") then
68+
vim.lsp.config("copilot", {
69+
handlers = {
70+
didChangeStatus = function(err, res, ctx)
71+
if err then
72+
return
73+
end
74+
status[ctx.client_id] = res.kind ~= "Normal" and "error" or res.busy and "pending" or "ok"
75+
if res.status == "Error" then
76+
LazyVim.error("Please use `:LspCopilotSignIn` to sign in to Copilot")
77+
end
78+
end,
79+
},
80+
})
8081
end
8182
end,
8283
},
@@ -94,17 +95,6 @@ opts = {
9495
opts = {
9596
servers = {
9697
copilot = {
97-
handlers = {
98-
didChangeStatus = function(err, res, ctx)
99-
if err then
100-
return
101-
end
102-
status[ctx.client_id] = res.kind ~= "Normal" and "error" or res.busy and "pending" or "ok"
103-
if res.status == "Error" then
104-
LazyVim.error("Please use `:LspCopilotSignIn` to sign in to Copilot")
105-
end
106-
end,
107-
},
10898
-- stylua: ignore
10999
keys = {
110100
{
@@ -125,13 +115,25 @@ opts = {
125115
setup = {
126116
copilot = function()
127117
vim.lsp.inline_completion.enable()
128-
129118
-- Accept inline suggestions or next edits
130119
LazyVim.cmp.actions.ai_accept = function()
131-
if vim.lsp.inline_completion.get() then
132-
-- nes_update() -- ensure nes update is triggered after inline completion
133-
return true
134-
end
120+
return vim.lsp.inline_completion.get()
121+
end
122+
123+
if not LazyVim.has_extra("ai.sidekick") then
124+
vim.lsp.config("copilot", {
125+
handlers = {
126+
didChangeStatus = function(err, res, ctx)
127+
if err then
128+
return
129+
end
130+
status[ctx.client_id] = res.kind ~= "Normal" and "error" or res.busy and "pending" or "ok"
131+
if res.status == "Error" then
132+
LazyVim.error("Please use `:LspCopilotSignIn` to sign in to Copilot")
133+
end
134+
end,
135+
},
136+
})
135137
end
136138
end,
137139
},
@@ -154,6 +156,9 @@ opts = {
154156

155157
```lua
156158
opts = function(_, opts)
159+
if LazyVim.has_extra("ai.sidekick") then
160+
return
161+
end
157162
table.insert(
158163
opts.sections.lualine_x,
159164
2,
@@ -176,6 +181,9 @@ end
176181
optional = true,
177182
event = "VeryLazy",
178183
opts = function(_, opts)
184+
if LazyVim.has_extra("ai.sidekick") then
185+
return
186+
end
179187
table.insert(
180188
opts.sections.lualine_x,
181189
2,

docs/extras/ai/copilot.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,45 @@ opts = {
8181

8282
</Tabs>
8383

84+
## [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
85+
86+
copilot-language-server
87+
88+
89+
<Tabs>
90+
91+
<TabItem value="opts" label="Options">
92+
93+
```lua
94+
opts = {
95+
servers = {
96+
-- copilot.lua only works with its own copilot lsp server
97+
copilot = { enabled = false },
98+
},
99+
}
100+
```
101+
102+
</TabItem>
103+
104+
105+
<TabItem value="code" label="Full Spec">
106+
107+
```lua
108+
{
109+
"neovim/nvim-lspconfig",
110+
opts = {
111+
servers = {
112+
-- copilot.lua only works with its own copilot lsp server
113+
copilot = { enabled = false },
114+
},
115+
},
116+
}
117+
```
118+
119+
</TabItem>
120+
121+
</Tabs>
122+
84123
## [copilot.lua](https://github.com/zbirenbaum/copilot.lua)
85124

86125
add ai_accept action

docs/extras/coding/blink.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ opts = {
220220
if opts.keymap.preset == "super-tab" then -- super-tab
221221
opts.keymap["<Tab>"] = {
222222
require("blink.cmp.keymap.presets").get("super-tab")["<Tab>"][1],
223-
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
223+
LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }),
224224
"fallback",
225225
}
226226
else -- other presets
227227
opts.keymap["<Tab>"] = {
228-
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
228+
LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }),
229229
"fallback",
230230
}
231231
end

docs/extras/coding/nvim-cmp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ opts = function()
5555
fallback()
5656
end,
5757
["<tab>"] = function(fallback)
58-
return LazyVim.cmp.map({ "snippet_forward", "ai_accept" }, fallback)()
58+
return LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }, fallback)()
5959
end,
6060
}),
6161
sources = cmp.config.sources({
@@ -149,7 +149,7 @@ end
149149
fallback()
150150
end,
151151
["<tab>"] = function(fallback)
152-
return LazyVim.cmp.map({ "snippet_forward", "ai_accept" }, fallback)()
152+
return LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }, fallback)()
153153
end,
154154
}),
155155
sources = cmp.config.sources({

0 commit comments

Comments
 (0)