zbirenbaum / copilot-cmp

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

can't see suggestions together with Lsp #100

Open sekomer opened 10 months ago

sekomer commented 10 months ago

this is my packer.lua file

...

    use {
        "zbirenbaum/copilot.lua",
        cmd = "Copilot",
        event = "InsertEnter",
        config = function()
            require("copilot").setup({
                suggestion = { enabled = false },
                panel = { enabled = false },
            })
        end,
    }

    use {
        "zbirenbaum/copilot-cmp",
        after = { "copilot.lua" },
        config = function ()
            require("copilot_cmp").setup({
                event = { "InsertEnter", "LspAttach" },
                fix_pairs = true,
            })
        end
    }

...

this is my cmp_config.lua file

local cmp = require('cmp')

print("Loading Copilot-cmp")

cmp.setup({
  sources = {
    { name = "copilot", group_index = 1, keyword_pattern = "." },
    { name = "nvim_lsp", group_index = 2 },
    { name = "buffer", group_index = 3 },
  },

  completion = {
    keyword_length = 2,
  },

  experimental = {
      ghost_text = true,
  }
})

when I'm writing code, only lsp suggestions showed, like in the next photo.

image

when there is no suggestions left, like the following

image

if I press tab, the copilot suggestions appear.

image

what's the problem, how can I get all suggestions together, without pressing tab explicitly and when there are other suggestions.

command-z-z commented 8 months ago

same problem.

Jagholin commented 6 months ago

I think I have the same problem with no copilot suggestions appearing in the cmp menu

kackerx commented 6 months ago

My phenomenon is that sometimes only copilot appears in the menu, and everything else I need is cleared

h4rldev commented 6 months ago

My phenomenon is that it doesn't appear at all

FelipeMarcelino commented 5 months ago

Same here!

sakithb commented 5 months ago

Same here

praveendhawan commented 5 months ago

same here

ek234 commented 5 months ago

for me, cmp never contains suggestions from copilot (if I turn on suggestions and auto_trigger, I can see the ghost text containing the copilot autocompletion). tried solutions from all the issues with this problem but nothing works. I'm using nvchad, if that is relevant.

the output of my LSPInfo

Language client log: /home/ek234/.local/state/nvim/lsp.log
Detected filetype:   cpp

2 client(s) attached to this buffer:

Client: clangd (id: 1, bufnr: [1])
 filetypes:       c, cpp, objc, objcpp, cuda, proto
 autostart:       true
 root directory:  /home/ek234/hobby/opengl/shapes
 cmd:             /usr/bin/clangd --offset-encoding=utf-16

Client: copilot (id: 2, bufnr: [1])
 filetypes:
 autostart:       false
 root directory:  /home/ek234/hobby/opengl/shapes
 cmd:             node /home/ek234/.local/share/nvim/lazy/copilot.lua/copilot/index.js

Configured servers list: pyright, eslint, clangd, lua_ls

edit: this seems relevant- the output of CmpStatus is:

# ready source names       
- luasnip                  
- buffer                   
- path                     
- nvim_lsp:clangd          
# unavailable source names 
- nvim_lua                 
# unused source names      
- copilot                  
ek234 commented 5 months ago

for me, cmp never contains suggestions from copilot (if I turn on suggestions and auto_trigger, I can see the ghost text containing the copilot autocompletion). tried solutions from all the issues with this problem but nothing works. I'm using nvchad, if that is relevant.

NVM solved it. I was not setting the nvim-cmp options correctly. solved it by doing:

  {
    "hrsh7th/nvim-cmp",
    event = "VeryLazy",
    config = function()
      local opts = require "plugins.configs.nvim-cmp"
      require("cmp").setup(opts)
    end
  },

Now I am having the OP's problem- I can only see either copilot's suggestions or other suggestions. :smiling_face_with_tear:

praveendhawan commented 5 months ago

So whats happening with me is when I type, suggestions from other sources come, later on copilots inserts suggestions. When those come, the other suggestions from previous sources are gone.

djm30 commented 2 months ago

Still happening

sekomer commented 2 months ago

wow, its been a year but there isn't any solution

I switched to copilot.vim, and suggest all the people here the same, cuz maintainer doesn't care this issue 🤣