Chaitanyabsprip / fastaction.nvim

Efficiency plugin designed to optimize code actions in Neovim
MIT License
57 stars 2 forks source link

Any hint on why I am getting this stacktrace? #2

Closed i3d closed 1 month ago

i3d commented 1 month ago

This is what I get from calling the code_action function.

E5108: Error executing lua .../share/nvim/lazy/fastaction.nvim/lua/fastaction/init.lua:109: Failed to find a key to map to "Disable diagnostics in the workspace (unused-local)."
stack traceback:
        [C]: in function 'assert'
        .../share/nvim/lazy/fastaction.nvim/lua/fastaction/init.lua:109: in function 'select'
        .../share/nvim/lazy/fastaction.nvim/lua/fastaction/init.lua:36: in function 'code_action'
        [string ":lua"]:1: in main chunk

The configuration I used is exactly the same as the example.

yujinyuz commented 1 month ago

getting the same error as well

flczcy commented 1 month ago

I guess it could be ipairs issues:

for ipairs table, the first item can't be nil

local funcs = { nil, 'a', 'b', 'c' }

vim.print(funcs)

-- { [2] = "a", [3] = "b", [4] = "c" }

-- nothing for print

for i, v in ipairs({ [2] = 'a', [3] = 'b', [4] = 'd' }) do print(i, v) end

-- 1 a 2 b
for i,v in ipairs({[1]='a', [2]='b', [4]='d'}) do print(i,v) end

ipairs(foo) need to check foo is not nil

for _, f in ipairs(funcs) do
Chaitanyabsprip commented 1 month ago

Thank you @flczcy That was the exact issue.