lspsaga.nvim icon indicating copy to clipboard operation
lspsaga.nvim copied to clipboard

Code action for source produces error

Open jacobrreed opened this issue 7 months ago • 1 comments

Describe the bug

When using require('lspsaga.codeaction').code_action({context={only="source"}}) the plugin produces an error image

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

jacobrreed avatar Jan 09 '24 18:01 jacobrreed

I am facing this too @glepnir

rubiin avatar Jan 31 '24 13:01 rubiin