Julian / lean.nvim

neovim support for the Lean theorem prover
MIT License
255 stars 25 forks source link

Error executing `vim.schedule` via lua callback #284

Closed mdgeorge4153 closed 1 year ago

mdgeorge4153 commented 1 year ago

I have just installed nvim, lean, and lean.nvim for the first time and am trying to get them set up. While navigating lean source, I encounter the following error:

Error executing vim.schedule lua callback: ...re/nvim/plugged/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: ...local/share/nvim/plugged/lean.nvim/lua/lean/infoview.lua:597:
 Error executing lua: ...local/share/nvim/plugged/lean.nvim/lua/lean/infoview.lua:598: attempt to index field 'cmd' (a function value)
stack traceback:
        ...local/share/nvim/plugged/lean.nvim/lua/lean/infoview.lua:598: in function <...local/share/nvim/plugged/lean.nvim/lua/lean/infoview.lua:598>
        [C]: in function 'resume'
        ...re/nvim/plugged/plenary.nvim/lua/plenary/async/async.lua:45: in function 'fn'
        ...e/.local/share/nvim/plugged/lean.nvim/lua/lean/_util.lua:129: in function 'handler'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1025: in function 'cb'
        vim/_editor.lua:256: in function <vim/_editor.lua:256>
stack traceback:
        [C]: in function 'error'
        ...re/nvim/plugged/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
        ...re/nvim/plugged/plenary.nvim/lua/plenary/async/async.lua:45: in function 'fn'
        ...e/.local/share/nvim/plugged/lean.nvim/lua/lean/_util.lua:129: in function 'handler'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1025: in function 'cb'
        vim/_editor.lua:256: in function <vim/_editor.lua:256>
Press ENTER or type command to continue

I am using lean 3, and installed the LSP using npm. I have installed nvim on ubuntu from the PPA,

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

My init.vim is taken from here: https://github.com/Julian/lean.nvim/wiki/Getting-Started#install-leannvim-and-its-dependencies

To reproduce, open src/data/finset.lean in mathlib and move to line 25 (this is the first file I've opened so I don't know how prevalent the problem is).

mdgeorge4153 commented 1 year ago

This appears to pop up every time I move into the RHS of a definition. Note that the info pane does populate.

Julian commented 1 year ago

Hey! I can try to have a look in a bit, so this is just a guess, but are you able to update to neovim 0.8 or newer perhaps and then retry? (Generally neovim itself and most plugins will only support the most recent release, think

Julian commented 1 year ago

Whoops, hit the wrong button, thanks github mobile -- anyways yeah I think this is complaining about us doing vim.cmd.normal which may be 0.8+ I forget -- if you can update (0.8.1 is out as of a month ago too) let me know if that works, otherwise can have a look when I'm back at a computer.

Julian commented 1 year ago

I pushed a commit which changes doing that line in a way that should work on <0.8, which I think might be the only one breaking your setup, but I'd still encourage updating to 0.8 (and 0.9 is going to be out soon) -- in general neovim itself only supports 2 versions (latest stable and latest nightly), so it's hard to support more than that downstream, but obviously I try not to break anything intentionally especially if the Ubuntu repos haven't caught up. Definitely share any feedback though (about this but in general!)