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 when using extra parameters with plugins. #150

Closed
Tracked by #149
lhandf opened this issue Aug 3, 2023 · 2 comments · Fixed by #157
Closed
Tracked by #149

Error when using extra parameters with plugins. #150

lhandf opened this issue Aug 3, 2023 · 2 comments · Fixed by #157
Labels
bug Something isn't working

Comments

@lhandf
Copy link

lhandf commented Aug 3, 2023

Describe the bug
I was cleaning up and adding some plugins around the time of the latest commit. I have paq configured to manage itself, so a :PaqSync probably updated it. I get this when running PaqSync now:

E5108: Error executing lua ...cal/share/nvim/site/pack/paqs/start/paq-nvim/lua/paq.lua:98: Cannot serialise function: type not supported
stack traceback:
        [C]: in function 'error'
        ...cal/share/nvim/site/pack/paqs/start/paq-nvim/lua/paq.lua:98: in function 'state_write'
        ...cal/share/nvim/site/pack/paqs/start/paq-nvim/lua/paq.lua:297: in function 'exe_op'
        ...cal/share/nvim/site/pack/paqs/start/paq-nvim/lua/paq.lua:353: in function 'clean'
        ...cal/share/nvim/site/pack/paqs/start/paq-nvim/lua/paq.lua:354: in function 'sync'
        [string ":lua"]:1: in main chunk

I removed the last plugin I added before the error, thinking it might be the cause, but the error remained. After some commenting, I've narrowed it down to this line in my config:

require "paq" {
    ...
    { "nvim-treesitter/nvim-treesitter", run = function () vim.cmd[[TSUpdate]] end },
    ...

There's no errors if I simply have "nvim-treesitter/nvim-treesitter", instead.

To Reproduce
Use the following with nvim -u:

require "paq" {
    "savq/paq-nvim",
    { "kvrohit/rasmus.nvim", run = function () print("hello") end },
}

Expected behavior
No errors.

Environment:

  • Arch Linux
  • nvim --version:
NVIM v0.9.0-dev-18-ga93ff5fc6
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/cmake.config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az96-559

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

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

Run :checkhealth for more info```
@lhandf lhandf added the bug Something isn't working label Aug 3, 2023
@saccarosium
Copy link
Collaborator

I've added a very primitive lockfile mechanism (#147) and was merge like 2 hours ago. The main issue is that vim.json.encode doesn't support decoding functions into json.

As a quickfix I will suggest you to pass to the run function directly the vim command you want to execute, like so:

{ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" },

As for the long run in future commits I will try to address this issue.

@lhandf
Copy link
Author

lhandf commented Aug 3, 2023

That works for me, using run = "TSUpdate". I appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants