simrat39 / rust-tools.nvim

Tools for better development in rust using neovim's builtin lsp
MIT License
2.17k stars 158 forks source link

Inlay hints not working #309

Closed Kryszak closed 1 year ago

Kryszak commented 1 year ago

After update of rust-tools and Mason rust-analyzer inlay hints stopped working with following error:

stack traceback:
        [C]: in function 'sub'
        ...ker/start/rust-tools.nvim/lua/rust-tools/inlay_hints.lua:216: in function 'render_line'
        ...ker/start/rust-tools.nvim/lua/rust-tools/inlay_hints.lua:260: in function 'render'
        ...ker/start/rust-tools.nvim/lua/rust-tools/inlay_hints.lua:170: in function 'handler'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1383: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
$ ./rust-analyzer --version
rust-analyzer 0.3.1344-standalone
augustocdias commented 1 year ago

The issue seems to be here as it is passing a table instead of a string:

https://github.com/simrat39/rust-tools.nvim/blob/master/lua/rust-tools/inlay_hints.lua#L216

kesleta commented 1 year ago

Seems like there's already a pull request to solve it: #308.

kesleta commented 1 year ago

This issue actually seems to be a duplicate of #300.

MichaelMandel26 commented 1 year ago

There are multiple PRs for this: https://github.com/simrat39/rust-tools.nvim/pull/307 and https://github.com/simrat39/rust-tools.nvim/pull/308

Firaenix commented 1 year ago

Same thing actually happens when opening the floating preview window too if you want to use the debugging feature

E5108: Error executing lua ...lar/neovim/0.8.1/share/nvim/runtime/lua/vim/lsp/util.lua:1525: contents: expected table, got nil
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        ...lar/neovim/0.8.1/share/nvim/runtime/lua/vim/lsp/util.lua:1525: in function 'open_floating_preview'
        [string ":lua"]:1: in main chunk
krolyxon commented 1 year ago

guys i dont think simrat39 is going to merge the pr any time soon, so just merge the pr into your own fork for now.

ostap-tymchenko commented 1 year ago

(for those who dont want to fork just use a pr's fork like https://github.com/kdarkhan/rust-tools.nvim temporary)

kesleta commented 1 year ago

Is there any reason why it's not getting merged? Is this repo just not being maintained very much currently?

anstadnik commented 1 year ago

I guess there is just an avalanche of issues, and @simrat39 cannot handle all of them instantly.

simrat39 commented 1 year ago

Fixed in https://github.com/simrat39/rust-tools.nvim/commit/a47f5d61ce06a433998fb5711f723773e3156f46

ostap-tymchenko commented 1 year ago

For everyone that temporeraly switched to a fork double check that you've switched back to main!