simrat39 / rust-tools.nvim

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

[BUG] Inlay hints: Index out of bounds error #349

Open LeonKowarschickKenbun opened 1 year ago

LeonKowarschickKenbun commented 1 year ago

Recently, I've been getting the following error every once in a while, without a clearly identifiable cause:

    Error  10:59:34 msg_show.lua_error Error executing vim.schedule lua callback: ...nvim/lazy/rust-tools.nvim/lua/rust-tools/inlay_hints.lua:142: Index out of bounds
  stack traceback:
    [C]: in function 'nvim_buf_get_lines'
    ...nvim/lazy/rust-tools.nvim/lua/rust-tools/inlay_hints.lua:142: in function 'parse_hints'
    ...nvim/lazy/rust-tools.nvim/lua/rust-tools/inlay_hints.lua:168: in function 'handler'
    /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1383: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>
mattfbacon commented 1 year ago

I get this error when I have an unclosed string literal. Very annoying.

adaszko commented 1 year ago

I'm getting these errors on an unclosed string literal, like let joined = snippet_lines.join("<CURSOR_IS_HERE>).

mattfbacon commented 1 year ago

I'm currently using https://github.com/MunifTanjim/rust-tools.nvim which does not have this issue.

druskus20 commented 10 months ago

Getting these errors as well: image