simrat39 / rust-tools.nvim

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

Errors after upgrading rust-analyzer > 2022-12-19 #312

Closed telbizov closed 1 year ago

telbizov commented 1 year ago

Hello everyone,

I recently starting using rust-tools and rust-analyzer with neovim. At the time of my installation the latest rust-analyzer version was 2022-12-19. Everything worked fine until the next version came up. After I upgraded it via Mason I started getting this error:

Error executing vim.schedule lua callback: ...ker/start/rust-tools.nvim/lua/rust-tools/inlay_hints.lua:216: bad argument #1 to 'sub' (string expected, got table)
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'
        ...l/Cellar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp.lua:1383: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Downgrading to MasonInstall rust-analyzer@2022-12-19 brings back the functionality. Latest version of rust-analyzer that I tested was 2023-01-02 and it still shows the same error.

Let me know if I am missing something or if I need to provide further information.

simrat39 commented 1 year ago

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

telbizov commented 1 year ago

Thanks. I can confirm that the fixed that that got merged works for me!

DieracDelta commented 1 year ago

I'm encountering this error again (except on line 211 instead of 216) on rustc 1.68.0 and nightly RA