save the file and current buffer will be like this:
use :Lspsaga diagnostic_jump_prev in line 2 and you will get an error:
and the error window spawned remain blank:
Actual behavior
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>
Expected behavior
Lspsaga spawn error window within error message and code action correctly
Support info
Lspinfo:
:Mason
Logs
No response
Additional information
I add vim.print() in setlines function in Lspsaga:
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
here is the result of the line information:
{ "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`" }
PS: this time I've taken a look at existing issues including this repository as well as lspsaga.nvim but find nothing similar. Forgive me if there's something I've missed that I haven't picked up on, I didn't mean to do it : )
Version confirmation
Following prerequisites
Not a user config issue
Neovim version
NVIM v0.9.4
Operating system/version
macOS 14.0
Terminal name/version
alacritty 0.12.3 (5efb069)
$TERM environment variable
No response
Branch info
main (Default/Latest)
Fetch Preferences
SSH (use_ssh = true)
Affected language servers
rust-analyzer
How to reproduce the issue
cargo new foo
nvim foo/src/main.rs
replace with the following code
save the file and current buffer will be like this:
use
:Lspsaga diagnostic_jump_prev
in line 2 and you will get an error:and the error window spawned remain blank:
Actual behavior
Expected behavior
Lspsaga spawn error window within error message and code action correctly
Support info
Lspinfo:
:Mason
Logs
No response
Additional information
I add
vim.print()
insetlines
function inLspsaga
:here is the result of the line information:
PS: this time I've taken a look at existing issues including this repository as well as lspsaga.nvim but find nothing similar. Forgive me if there's something I've missed that I haven't picked up on, I didn't mean to do it : )