@@ -39,17 +39,6 @@ import TabItem from '@theme/TabItem';
39
39
opts = {
40
40
servers = {
41
41
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
- },
53
42
-- stylua: ignore
54
43
keys = {
55
44
{
@@ -70,13 +59,25 @@ opts = {
70
59
setup = {
71
60
copilot = function ()
72
61
vim .lsp .inline_completion .enable ()
73
-
74
62
-- Accept inline suggestions or next edits
75
63
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
+ })
80
81
end
81
82
end ,
82
83
},
@@ -94,17 +95,6 @@ opts = {
94
95
opts = {
95
96
servers = {
96
97
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
- },
108
98
-- stylua: ignore
109
99
keys = {
110
100
{
@@ -125,13 +115,25 @@ opts = {
125
115
setup = {
126
116
copilot = function ()
127
117
vim .lsp .inline_completion .enable ()
128
-
129
118
-- Accept inline suggestions or next edits
130
119
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
+ })
135
137
end
136
138
end ,
137
139
},
@@ -154,6 +156,9 @@ opts = {
154
156
155
157
``` lua
156
158
opts = function (_ , opts )
159
+ if LazyVim .has_extra (" ai.sidekick" ) then
160
+ return
161
+ end
157
162
table.insert (
158
163
opts .sections .lualine_x ,
159
164
2 ,
176
181
optional = true ,
177
182
event = " VeryLazy" ,
178
183
opts = function (_ , opts )
184
+ if LazyVim .has_extra (" ai.sidekick" ) then
185
+ return
186
+ end
179
187
table.insert (
180
188
opts .sections .lualine_x ,
181
189
2 ,
0 commit comments