zbirenbaum / copilot-cmp

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

Copilot-cmp crashes on startup #97

Open paulkass opened 11 months ago

paulkass commented 11 months ago

Whenever packer tries to initialize copilot-cmp, it crashes with the following error:

packer.nvim: Error running config for copilot-cmp: ...ite/pack/packer/opt/copilot-cmp/lua/copilot_cmp/init.lua:41: unexpected event

I'm not sure how to remedy this. Here are my packer configs:

--For Copilot
use {
    'zbirenbaum/copilot.lua',
    cmd = "Copilot",
    event = "InsertEnter",
    config = function() 
        require("copilot").setup({
          copilot_node_command = vim.fn.expand("$HOME") .. "/.nvm/versions/node/v18.18.2/bin/node",
          panel = {
            enabled = false,
          },
          suggestion = {
            enabled = false
            -- auto_trigger = false,
          },
        server_opts_overrides = {},
        })
    end
}

use {
    'zbirenbaum/copilot-cmp',
    after = { 'copilot.lua', 'nvim-cmp'},
    config = function()
        require('copilot_cmp').setup()    
    end
}

LSPInfo suggests Copilot is working: image

I'm using node 18.18 and here is my nvim --version output:

NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info