jinzhongjia / LspUI.nvim

A modern and useful UI plugin that wraps lsp operations.
MIT License
158 stars 4 forks source link

inlay_hint error (bufnr expected number) after updating plugin to latest #42

Open pabloasanchez opened 1 week ago

pabloasanchez commented 1 week ago

Hello, I recently updated LspUI and started having this issue. I'm using neovim v0.10.0-dev

Error detected while processing LspAttach Autocommands for "*":                                                                                                                      
Error executing lua callback: /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:369: bufnr: expected number, got boolean
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:369: in function 'inlay_hint'
        .../.vim/vendor/LspUI.nvim/lua/LspUI/inlay_hint/init.lua:108: in function <.../.vim/vendor/LspUI.nvim/lua/LspUI/inlay_hint/init.lua:68>
        [C]: in function 'nvim_exec_autocmds'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1722: in function '_on_attach'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1472: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue
jinzhongjia commented 1 week ago

ok, I will fix this

jinzhongjia commented 1 week ago

oh, wait, you are using 0.10 dev ? You may be using the past development version. In fact, 0.10 has been released. Before the release of 0.10, there were some API changes related to inlay_hint, but I deleted the compatibility code corresponding to this part after the release of 0.10.

jinzhongjia commented 1 week ago

I can't reproduce your problem at the moment. Maybe you can try upgrading your neovim? LspUI currently runs fine on 0.10 and the latest master

jinzhongjia commented 1 week ago

Or you can try to roll back a commit, I won't be adding new features in the near future https://github.com/jinzhongjia/LspUI.nvim/commit/8f0232af2a08ad881ac438a3ad85d2d6f7f6f05c It should be caused by this commit, but this commit only deletes a part of the invalid code used to adapt to 0.10 dev

pabloasanchez commented 1 week ago

Thank you! I will try that.

pabloasanchez commented 1 week ago

oh, wait, you are using 0.10 dev ? You may be using the past development version. In fact, 0.10 has been released. Before the release of 0.10, there were some API changes related to inlay_hint, but I deleted the compatibility code corresponding to this part after the release of 0.10.

Thanks! Yep, sounds like this might be the issue. I will try updating my neovim or rolling back if that doesn't work. Thank you for taking a look!