zbirenbaum / copilot-cmp

Lua plugin to turn github copilot into a cmp source
MIT License
1.07k stars 38 forks source link

Not getting suggestions into my cmp #78

Closed aneshodza closed 10 months ago

aneshodza commented 1 year ago

I recently got the issue that the copilot suggestions don't show up in my cmp (but running :Copilot suggestion shows what it should): gif of it not working

My lazy.nvim download:

  -- copilot
  {
    "zbirenbaum/copilot.lua",
    event = "InsertEnter",
    opts = overrides.copilot,
  },

  {
    "zbirenbaum/copilot-cmp",
    config = function ()
      require("copilot_cmp").setup()
    end
  },

And the cmp groups:

  sources = {
    { name = "nvim_lsp", group_index = 2 },
    { name = "copilot",  group_index = 2 },
    { name = "luasnip",  group_index = 2 },
    { name = "buffer",   group_index = 2 },
    { name = "nvim_lua", group_index = 2 },
    { name = "path",     group_index = 2 },
  },

For a more detailed look, check out my nvchad config

:Copilot status yields:

[Copilot] Online
[Copilot] Enabled for ruby

Update: running :LspLog shows something interesting: The language server copilot triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless

aneshodza commented 1 year ago

I think I solved it: I had steep as an lsp on. That caused copilot to not show in the cmp settings. Hope this helps someone in the future.

skmtkytr commented 11 months ago

@aneshodza same trouble now. Im using Steep LSP too. How fix this?

aneshodza commented 11 months ago

@aneshodza same trouble now. Im using Steep LSP too. How fix this?

I think the issue was even that one of my LSPs was crashing (in this case Steep) and that caused it. Make sure you have a Steepfile in the project, that should fix it.

If it doesn't maybe you can investigate further and post your findings. If it's a compatability problem it should be fixed.