Closed cxzhou35 closed 10 months ago
It looked like in the post on copilot.lua you had suggestions in the cmp window correct? If that's the case this is working normally.
But if
copilot.lua
is working as expected, some texts will appear in the context of my code?I still can't see any code suggestions provided by
copilot.lua
without thenvim-cmp
popup window.
Copilot.vim/copilot.lua style inline text suggestions are mutually exclusive with copilot-cmp. This is a limitation brought on by nvim-cmp's ghost text which doesn't support multiline suggestions.
It looked like in the post on copilot.lua you had suggestions in the cmp window correct? If that's the case this is working normally.
But if
copilot.lua
is working as expected, some texts will appear in the context of my code? I still can't see any code suggestions provided bycopilot.lua
without thenvim-cmp
popup window.Copilot.vim/copilot.lua style inline text suggestions are mutually exclusive with copilot-cmp. This is a limitation brought on by nvim-cmp's ghost text which doesn't support multiline suggestions.
Sorry, I didn't say it clearly, I disabled the copilot-cmp plugin, and in this case I even can't see any suggestions provided by copilot. Now I can't see any suggestions in both cmp popup window and neovim editor window.
I just want the suggestions in the nvim-cmp popup window.
I just want the suggestions in the nvim-cmp popup window.
Can you check what :LspLog reports? Also can you try removing copilot-cmp and enable suggestions for copilot.lua to see if they appear that way?
I just want the suggestions in the nvim-cmp popup window.
Can you check what :LspLog reports? Also can you try removing copilot-cmp and enable suggestions for copilot.lua to see if they appear that way?
I notice that you also reply in the copilot.lua, you can find my solution in this comment, now the copilot is work, but the integration of cmp still failed.
return {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
build = ":Copilot auth",
module = "copilot",
opts = {
suggestion = { enabled = false },
panel = { enabled = false },
filetypes = {
yaml = false,
markdown = false,
help = false,
gitcommit = false,
gitrebase = false,
hgcommit = false,
svn = false,
cvs = false,
},
},
},
{
"zbirenbaum/copilot-cmp",
dependencies = "copilot.lua",
event = { "InsertEnter", "LspAttach" },
fix_pairs = true,
config = function(_, opts)
local copilot_cmp = require("copilot_cmp")
copilot_cmp.setup(opts)
-- attach cmp source whenever copilot attaches
-- fixes lazy-loading issues with the copilot cmp source
require("lazyvim.util").on_attach(function(client)
if client.name == "copilot" then
copilot_cmp._on_insert_enter({})
end
end)
end,
},
}
Not sure if it's similar to your issue but I had a similar symptom with 'clangd' and 'ccls' active at the same time: Copilot suggestion was working but the integration of cmp was failed, suggestion not showing the cmp menu.
After digging a bit, I think it's because of the wrong check here
I made a quick fix and PR here. Now I can see the copilot suggestion in cmp menu:
Could you check if it also resolves your issue @cxzhou35
My Neovim version: NVIM v0.10.0-dev-604+gd191bdf9d
P/S: I guess it's also related to issue #78
I just want the suggestions in the nvim-cmp popup window.
Can you check what :LspLog reports? Also can you try removing copilot-cmp and enable suggestions for copilot.lua to see if they appear that way?
I notice that you also reply in the copilot.lua, you can find my solution in this comment, now the copilot is work, but the integration of cmp still failed.
return { { "zbirenbaum/copilot.lua", cmd = "Copilot", event = "InsertEnter", build = ":Copilot auth", module = "copilot", opts = { suggestion = { enabled = false }, panel = { enabled = false }, filetypes = { yaml = false, markdown = false, help = false, gitcommit = false, gitrebase = false, hgcommit = false, svn = false, cvs = false, }, }, }, { "zbirenbaum/copilot-cmp", dependencies = "copilot.lua", event = { "InsertEnter", "LspAttach" }, fix_pairs = true, config = function(_, opts) local copilot_cmp = require("copilot_cmp") copilot_cmp.setup(opts) -- attach cmp source whenever copilot attaches -- fixes lazy-loading issues with the copilot cmp source require("lazyvim.util").on_attach(function(client) if client.name == "copilot" then copilot_cmp._on_insert_enter({}) end end) end, }, }
Not sure if it's similar to your issue but I had a similar symptom with 'clangd' and 'ccls' active at the same time: Copilot suggestion was working but the integration of cmp was failed, suggestion not showing the cmp menu.
After digging a bit, I think it's because of the wrong check here
I made a quick fix and PR here. Now I can see the copilot suggestion in cmp menu:
Could you check if it also resolves your issue @cxzhou35
My Neovim version: NVIM v0.10.0-dev-604+gd191bdf9d
P/S: I guess it's also related to issue #78
I just want the suggestions in the nvim-cmp popup window.
Can you check what :LspLog reports? Also can you try removing copilot-cmp and enable suggestions for copilot.lua to see if they appear that way?
I notice that you also reply in the copilot.lua, you can find my solution in this comment, now the copilot is work, but the integration of cmp still failed.
return { { "zbirenbaum/copilot.lua", cmd = "Copilot", event = "InsertEnter", build = ":Copilot auth", module = "copilot", opts = { suggestion = { enabled = false }, panel = { enabled = false }, filetypes = { yaml = false, markdown = false, help = false, gitcommit = false, gitrebase = false, hgcommit = false, svn = false, cvs = false, }, }, }, { "zbirenbaum/copilot-cmp", dependencies = "copilot.lua", event = { "InsertEnter", "LspAttach" }, fix_pairs = true, config = function(_, opts) local copilot_cmp = require("copilot_cmp") copilot_cmp.setup(opts) -- attach cmp source whenever copilot attaches -- fixes lazy-loading issues with the copilot cmp source require("lazyvim.util").on_attach(function(client) if client.name == "copilot" then copilot_cmp._on_insert_enter({}) end end) end, }, }
Thanks to your detailed reply, I will try your solution and give my results as soon as possible.
I have viewed the similar issues in this repo, but none of them worked, so I raise a new issue to ask for help.
I have setup both copilot.lua and copilot-cmp plugins, the config is below(based on LazyVim):
How to reproduce:
LspInfo result:
Lualine Status(The copilot status is online):
Anyone can provide the solutions for me? Thanks a lot. :)