nvimdev / lspsaga.nvim

improve neovim lsp experience

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Lspsaga project_replace` error : `bad argument #1 to 'unpack'`

ls-devs opened this issue · comments

Describe the bug

Hi,
Using the function Lspsaga project_replace test123 test throw this error :

Error executing Lua callback: ...re/nvim/lazy/lspsaga.nvim/lua/lspsaga/rename/project.lua:173: bad argument #1 to 'unpack' (table expected, got nil)
stack traceback:
	[C]: in function 'unpack'
	...re/nvim/lazy/lspsaga.nvim/lua/lspsaga/rename/project.lua:173: in function 'new'
	...cal/share/nvim/lazy/lspsaga.nvim/lua/lspsaga/command.lua:23: in function <...cal/share/nvim/lazy/lspsaga.nvim/lua/lspsaga/command.lua:22>
	...cal/share/nvim/lazy/lspsaga.nvim/lua/lspsaga/command.lua:74: in function 'load_command'
	...s/.local/share/nvim/lazy/lspsaga.nvim/plugin/lspsaga.lua:8: in function <...s/.local/share/nvim/lazy/lspsaga.nvim/plugin/lspsaga.lua:7>
E16: Invalid range

I managed to make it work by replacing

    args = { args[1], root_dir, '--json', unpack(args[3]) },

by

    args = { args[1], root_dir, '--json', args[3) },

But I'm not really sure what I'm doing here.

Steps to reproduce

1 - Run Lspsaga project_replace arg1 arg2
2 - Throw error

Expected behavior

Show the popup as described on https://nvimdev.github.io/lspsaga/rename/

Neovim version (nvim -v)

NVIM v0.10.0-dev-2317+g44ec4b5b1

lspsaga commit

2198c07

Terminal name/version

Windows 11 Terminal - WSL