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

Error executing lua E114: Missing quote #3

Closed
bashtoni opened this issue Apr 4, 2022 · 12 comments
Closed

Error executing lua E114: Missing quote #3

bashtoni opened this issue Apr 4, 2022 · 12 comments

Comments

@bashtoni
Copy link

bashtoni commented Apr 4, 2022

I'm using LunarVim, and I added copilot to my Packer config (lvim.plugins) like so:

  -- github copilot
  {
    "zbirenbaum/copilot.lua",
    event = "InsertEnter",
    config = function ()
      vim.schedule(function() require("copilot") end)
    end
  },
  {
    "zbirenbaum/copilot-cmp",
    after = {"copilot.lua", "nvim-cmp"},
    config = function ()
      lvim.builtin.cmp.formatting.source_names["copilot"] = ""
      table.insert(lvim.builtin.cmp.sources, {name = "copilot"})
    end
  },

When I enter insert mode I get this error message:

Error detected while processing InsertEnter Autocommands for "*":
E5108: Error executing lua ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:165: Vim(echomsg):E114: Missing quote: "Error in packer_compiled: ...m/s
ite/pack/packer/start/packer.nvim/lua/packer/load.lua:142: Vim(source):E5113: Error while calling lua chunk: ...ite/pack/packer/opt/copilot-cmp/lua/copilot_cmp
/init.lua:9: attempt to call field 'nvim_create_autocmd' (a nil value)
stack traceback:
        [C]: in function 'cmd'
        ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:165: in function <...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:161>
        [string ":lua"]:1: in main chunk
@zbirenbaum
Copy link
Owner

You aren't on neovim nightly. You are using .6 so nvim_create_autocmd isn't a function yet.

Try getting a nightly image from the neovim github page or build one from source.

@zbirenbaum
Copy link
Owner

zbirenbaum commented Apr 4, 2022

Since it was fast and I think that there was the only place I used it, I added a version check. PackerSync and try again.

Let me know if it works so I can approve this for .6 if it does.

@bashtoni
Copy link
Author

bashtoni commented Apr 4, 2022

Thanks. Sadly, I've updated and the only difference seems to be that the error is one line further on:

Error detected while processing InsertEnter Autocommands for "*":
E5108: Error executing lua ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:165: Vim(echomsg):E114: Missing quote: "Error in packer_compiled: ...m/s
ite/pack/packer/start/packer.nvim/lua/packer/load.lua:142: Vim(source):E5113: Error while calling lua chunk: ...ite/pack/packer/opt/copilot-cmp/lua/copilot_cmp
/init.lua:10: attempt to call field 'nvim_create_autocmd' (a nil value)
stack traceback:
        [C]: in function 'cmd'
        ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:165: in function <...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:161>
        [string ":lua"]:1: in main chunk

@zbirenbaum
Copy link
Owner

Thanks. Sadly, I've updated and the only difference seems to be that the error is one line further on:

Error detected while processing InsertEnter Autocommands for "*":
E5108: Error executing lua ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:165: Vim(echomsg):E114: Missing quote: "Error in packer_compiled: ...m/s
ite/pack/packer/start/packer.nvim/lua/packer/load.lua:142: Vim(source):E5113: Error while calling lua chunk: ...ite/pack/packer/opt/copilot-cmp/lua/copilot_cmp
/init.lua:10: attempt to call field 'nvim_create_autocmd' (a nil value)
stack traceback:
        [C]: in function 'cmd'
        ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:165: in function <...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:161>
        [string ":lua"]:1: in main chunk

Run this in command mode and lmk what it says:
lua print(vim.fn.has('nvim-0.7'))

@bashtoni
Copy link
Author

bashtoni commented Apr 4, 2022

That command returns 0

Output of nvim --version:

NVIM v0.6.1
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/builddir/build/BUILD/neovim-0.6.1/redhat-linux-build/config -I/builddir/build/BUILD/neovim-0.6.1/src -I/usr/include -I/usr/include/luajit-2.1 -I/builddir/build/BUILD/neovim-0.6.1/redhat-linux-build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.6.1/redhat-linux-build/include
Compiled by mockbuild@koji

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

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

@zbirenbaum
Copy link
Owner

wait I know this issue. give me one sec

@zbirenbaum
Copy link
Owner

PackerSync try again.

@bashtoni
Copy link
Author

bashtoni commented Apr 4, 2022

Thanks, we're getting somewhere!
I now get this error when entering insert mode:

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:262: cmd: expected string, got nil
stack traceback:                                                                                                                                     
        [C]: in function 'error'
        vim/shared.lua:608: in function 'validate'
        /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:262: in function 'start'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:802: in function 'start_client'
        ...k/packer/opt/copilot.lua/lua/copilot/copilot_handler.lua:20: in main chunk
        [C]: in function 'require'
        ...im/site/pack/packer/opt/copilot.lua/lua/copilot/init.lua:1: in main chunk
        [C]: in function 'require'
        [string "..."]: in function <[string "..."]:0>

@zbirenbaum
Copy link
Owner

Thanks, we're getting somewhere! I now get this error when entering insert mode:

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:262: cmd: expected string, got nil
stack traceback:                                                                                                                                     
        [C]: in function 'error'
        vim/shared.lua:608: in function 'validate'
        /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:262: in function 'start'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:802: in function 'start_client'
        ...k/packer/opt/copilot.lua/lua/copilot/copilot_handler.lua:20: in main chunk
        [C]: in function 'require'
        ...im/site/pack/packer/opt/copilot.lua/lua/copilot/init.lua:1: in main chunk
        [C]: in function 'require'
        [string "..."]: in function <[string "..."]:0>

I think LunarVim installs plugins somewhere different than the default. Can you locate where exactly your plugins are installed and let me know the path?

Then, can you supply the output of :lua print(vim.fn.stdpath("data"))

@bashtoni
Copy link
Author

bashtoni commented Apr 5, 2022

It seems to be storing them in $HOME/.local/share/lunarvim/site/pack/packer

:lua print(vim.fn.stdpath("data")) returns /home/sam/.local/share/nvim

@zbirenbaum
Copy link
Owner

zbirenbaum commented Apr 5, 2022

@bashtoni Just pushed a fix. Set your packer use to look like this:

use {
      "zbirenbaum/copilot.lua",
      event = "InsertEnter",
      config = function ()
         vim.schedule(function()
            require("copilot.copilot_handler").start(vim.fn.expand("$HOME") .. "/.local/share/lunarvim/")
         end)
      end,
   },

edit: sorry had my non standard plugin install format pasted.

@bashtoni
Copy link
Author

bashtoni commented Apr 5, 2022

Thanks for all your help - that's working now.

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

2 participants