zbirenbaum / copilot-cmp

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

Pressing <cr> on terraformls completion fails #101

Closed fishman closed 9 months ago

fishman commented 9 months ago

This issue seems to occur when I use copilot_cmp instead of lsp.setup (lsp-zero).

-- lsp.setup()
require('copilot_cmp').setup()
E5108: Error executing lua [string ":lua"]:156: module '' not found:
        no field package.preload['']
        no file './.lua'
        no file '/usr/share/luajit-2.1/.lua'
        no file '/usr/local/share/lua/5.1/.lua'
        no file '/usr/local/share/lua/5.1//init.lua'
        no file '/usr/share/lua/5.1/.lua'
        no file '/usr/share/lua/5.1//init.lua'
        no file './.so'
        no file '/usr/local/lib/lua/5.1/.so'
        no file '/usr/lib/lua/5.1/.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        [string ":lua"]:156: in function 'expand'
        //.vim/plugged/nvim-cmp/lua/cmp/core.lua:488: in function <//.vi
m/plugged/nvim-cmp/lua/cmp/core.lua:434>
        .../.vim/plugged/nvim-cmp/lua/cmp/utils/feedkeys.lua:47: in function <....v
im/plugged/nvim-cmp/lua/cmp/utils/feedkeys.lua:45>
fishman commented 9 months ago

It seems to treat the terraformls completion as a snippet even though it is not

      if is_snippet then
        config.get().snippet.expand({
          body = new_text,
          insert_text_mode = completion_item.insertTextMode,
        })
      end
fishman commented 9 months ago

Seems like I had a left over entry in my snippet configuration which would trigger sometimes.