Closed cxzhou35 closed 1 year ago
Looks like an issue for https://github.com/zbirenbaum/copilot-cmp/issues
You're not using any features of copilot.lua
directly.
If :Copilot status
output looks okay, copilot.lua
is working as expected.
Looks like an issue for https://github.com/zbirenbaum/copilot-cmp/issues
You're not using any features of
copilot.lua
directly.If
:Copilot status
output looks okay,copilot.lua
is working as expected.
Thanks for your reply, I will raise this issue to the copilot-cmp repo and close this issue.
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 the nvim-cmp
popup window.
I still can't see any code suggestions provided by copilot.lua
You've set:
suggestion = { enabled = false },
panel = { enabled = false },
that would be the reason.
Check this for the guide: https://github.com/zbirenbaum/copilot.lua/discussions/99#discussioncomment-4483942
Now I changed my config according to the guide, here is the result:
:Copilot auth
:
:Copilot status
:
Sad, still no suggestions..
Did you enable auto trigger? You'll need to either enable auto trigger, or trigger manually.
Also try writing some characters (e.g. func
) and see if copilot completes it. Sometimes copilot doesn't suggest anything for empty lines.
What does :Copilot version
output?
If nothing works, you can try two last things:
:Copilot auth signout
and :Copilot auth signin
again.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.
If nothing works, you can try two last things:
:Copilot auth signout
and:Copilot auth signin
again.- If that doesn't work... Try out the official https://github.com/github/copilot.vim plugin to see if it works. Could be that your account (or IP address) is blocked from using Copilot for some reason.
I'm sorry for the late reply due to my final exam, now my config is below:
-- copilot
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
build = ":Copilot auth",
opts = {
suggestion = {
enabled = true,
auto_trigger = true,
},
panel = {
enabled = true,
auto_refresh = false,
},
},
}
That works, thank you for your quick reply.
However, my copilot-cmp plugin still not work at all, in its repo I found this hint:
If I change the config to this one, the copilot will not work, here is my copilot config with the cmp integration:
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,
},
}
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. :)