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

Code action for source produces error #1376

Open
jacobrreed opened this issue Jan 9, 2024 · 1 comment
Open

Code action for source produces error #1376

jacobrreed opened this issue Jan 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jacobrreed
Copy link

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 jacobrreed added the bug Something isn't working label Jan 9, 2024
@rubiin
Copy link

rubiin commented Jan 31, 2024

I am facing this too @glepnir

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

2 participants