Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ls-devs opened this issue Feb 10, 2024 · 2 comments
Open

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

ls-devs opened this issue Feb 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ls-devs
Copy link

ls-devs commented Feb 10, 2024

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

@ls-devs ls-devs added the bug Something isn't working label Feb 10, 2024
@ls-devs ls-devs changed the title Lspsaga project_name error : bad argument #1 to 'unpack' Lspsaga project_rename error : bad argument #1 to 'unpack' Feb 10, 2024
@ls-devs ls-devs changed the title Lspsaga project_rename error : bad argument #1 to 'unpack' Lspsaga project_replace error : bad argument #1 to 'unpack' Feb 10, 2024
@SerkanSipahi
Copy link

SerkanSipahi commented Aug 16, 2024

@glepnir I am facing the same issue. Any updates regarding this issue?

@echaya
Copy link

echaya commented Dec 29, 2024

I have just migrated to lspsaga and facing the same issue. Not entirely sure why we need unpack here. Worth opening a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants