lspsaga.nvim
lspsaga.nvim copied to clipboard
Code action for source produces error
Describe the bug
When using require('lspsaga.codeaction').code_action({context={only="source"}})
the plugin produces an error
Steps to reproduce
I have the following for the lazy definition:
{
"nvimdev/lspsaga.nvim",
event = { "LspAttach" },
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
config = function(opts)
local lspsaga = require("lspsaga")
lspsaga.setup(opts)
end,
keys = {
...
{
"<leader>cA",
function()
require("lspsaga.codeaction").code_action({ context = { only = "source" } })
end,
desc = "Code action (source)",
},
},
},
When running it in a typescript file but could fail in others, I get an error about attempt to call method 'send_request' (a nil value)
Expected behavior
I expect the function to show Lspsaga code_action window for the source context, similar to vim.lsp.buf.code_action({context={only={"source"}, diagnostics={}}})
Neovim version (nvim -v)
NVIM v0.10.0-dev-1809+g529498685
lspsaga commit
3112b7a
Terminal name/version
Wezterm 20230712-072601-f4abf8fd
I am facing this too @glepnir