while using :Lspsaga diagnose_jump_next in rust project with rust-analyzer lsp, it errors with following error message:
Error executing Lua callback: ...share/nvim/site/lazy/lspsaga.nvim/lua/lspsaga/window.lua:118: 'replacement string' item contains newlines
stack traceback:
[C]: in function 'nvim_buf_set_lines'
...share/nvim/site/lazy/lspsaga.nvim/lua/lspsaga/window.lua:118: in function 'setlines'
...m/site/lazy/lspsaga.nvim/lua/lspsaga/diagnostic/init.lua:313: in function 'render_diagnostic_window'
...m/site/lazy/lspsaga.nvim/lua/lspsaga/diagnostic/init.lua:423: in function 'move_cursor'
...m/site/lazy/lspsaga.nvim/lua/lspsaga/diagnostic/init.lua:437: in function 'goto_next'
...hare/nvim/site/lazy/lspsaga.nvim/lua/lspsaga/command.lua:41: in function <...hare/nvim/site/lazy/lspsaga.nvim/lua/lspsaga/command.lua:40>
...hare/nvim/site/lazy/lspsaga.nvim/lua/lspsaga/command.lua:74: in function 'load_command'
...cal/share/nvim/site/lazy/lspsaga.nvim/plugin/lspsaga.lua:8: in function <...cal/share/nvim/site/lazy/lspsaga.nvim/plugin/lspsaga.lua:7>
from the stack traceback, I change the function setlines to print the actual line:
function obj:setlines(lines, row, erow)
row = row or 0
erow = erow or -1
vim.print(lines)
api.nvim_buf_set_lines(self.bufnr, row, erow, false, lines)
return self
end
lua runtime prints the following line before lspsaga throwing the error as the result of following steps of reproduce
{ "cannot find type `BTreeMap` in this scope", "not found in this scope", "main.rs(1:0): consider importing this struct: `use std::collections::BTreeMap;\n\n`" }
Describe the bug
while using
:Lspsaga diagnose_jump_next
in rust project with rust-analyzer lsp, it errors with following error message:from the stack traceback, I change the function
setlines
to print the actual line:lua runtime prints the following line before lspsaga throwing the error as the result of following steps of reproduce
Steps to reproduce
cargo new foo
:Lspsaga diagnose_jump_next
in line 2Expected behavior
Lspsaga spawn error window within error message and code action correctly
Neovim version (nvim -v)
NVIM v0.9.4
lspsaga commit
8b02796
Terminal name/version
alacritty 0.12.3 (5efb069)