Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't see suggestions together with Lsp #100

Open
sekomer opened this issue Nov 26, 2023 · 10 comments
Open

can't see suggestions together with Lsp #100

sekomer opened this issue Nov 26, 2023 · 10 comments

Comments

@sekomer
Copy link

sekomer commented Nov 26, 2023

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
Copy link

command-z-z commented Jan 9, 2024

same problem.

@Jagholin
Copy link

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

@kackerx
Copy link

kackerx commented Mar 28, 2024

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

@h4rldev
Copy link

h4rldev commented Apr 6, 2024

My phenomenon is that it doesn't appear at all

@FelipeMarcelino
Copy link

Same here!

@sakithb
Copy link

sakithb commented Apr 13, 2024

Same here

@praveendhawan
Copy link

same here

@ek234
Copy link

ek234 commented Apr 24, 2024

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
Copy link

ek234 commented Apr 24, 2024

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. 🥲

@praveendhawan
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants