Chaitanyabsprip / fastaction.nvim

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

Failed to find a key to map to ... #6

Closed eslam-allam closed 2 weeks ago

eslam-allam commented 1 month ago

When attempting to perform code actions in java using jdtls (specifically on a missing import) I get this error:

Error executing vim.schedule lua callback: .../share/nvim/lazy/fastaction.nvim/lua/fastaction/init.lua:106: Failed to find a key to map to "Generate toString()"
stack traceback:
    [C]: in function 'assert'
    .../share/nvim/lazy/fastaction.nvim/lua/fastaction/init.lua:106: in function 'select'
    /usr/share/nvim/runtime/lua/vim/lsp/buf.lua:837: in function 'on_code_action_results'
    /usr/share/nvim/runtime/lua/vim/lsp/buf.lua:885: in function 'handler'
    /usr/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

and some times this error:

Error executing vim.schedule lua callback: .../share/nvim/lazy/fastaction.nvim/lua/fastaction/init.lua:106: Failed to find a key to map to "Override/Implement Methods..."
stack traceback:
    [C]: in function 'assert'
    .../share/nvim/lazy/fastaction.nvim/lua/fastaction/init.lua:106: in function 'select'
    /usr/share/nvim/runtime/lua/vim/lsp/buf.lua:837: in function 'on_code_action_results'
    /usr/share/nvim/runtime/lua/vim/lsp/buf.lua:885: in function 'handler'
    /usr/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

I'm overriding vim.ui.select like so:

{
    "Chaitanyabsprip/fastaction.nvim",
    config = true,
    init = function()
      ---@diagnostic disable-next-line: duplicate-set-field
      vim.ui.select = require("fastaction").select
    end,
  }

Edit: Here are the actions if viewed using telescope: image image image

Could this be happening because there are too many code actions available and the plugin is running out of letters to assign to each one?