zbirenbaum / copilot-cmp

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

Not getting suggestion in cmp menu #86

Closed chojs23 closed 1 year ago

chojs23 commented 1 year ago

The suggestion of copilot doesn't appear in cmp menu (or very slow), but the suggestion of copilot.lua was very fast and even on the empty line gave suggestion.

When suggestion = { enabled = true } , if I insert just single character, the copilot gives me suggestion immediately but copilot.cmp never show those suggestions.

--- copilot.lua
return {
  {
    "zbirenbaum/copilot.lua",
    cmd = "Copilot",
    build = ":Copilot auth",
    event = "LspAttach",
    opts = {
      suggestion = { enabled = true },       <----- If enabled = false, cannot get suggestion on cmp menu
      panel = { enabled = true },
      filetypes = {
        markdown = true,
        help = true,
      },
    },
  },
  {
    "zbirenbaum/copilot-cmp",
    dependencies = "copilot.lua",
    event = "LspAttach",
    opts = {},
    config = function(_, opts)
      local copilot_cmp = require("copilot_cmp")
      copilot_cmp.setup(opts)
      require("lazyvim.util").on_attach(function(client)
        if client.name == "copilot" then
          copilot_cmp._on_insert_enter({})
        end
      end)
    end,

  },
}

스크린샷 2023-08-13 오후 11 46 45

Anyone who figure out this problem?

Update : #72 after changing config to suggestion = { enabled = true, auto_trigger = false } it updates cmp menu properly.

zbirenbaum commented 1 year ago

suggestion = { enabled = false, auto_trigger = false } should work fine (it does for me) and is the recommended setup. In your example auto_trigger isn't explicitly set to false, which may have caused this behavior. If this is not the case, please reopen the issue and I will do some further tests.