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 error with diagnostic #1433

Closed
Gitfz810 opened this issue May 2, 2024 · 2 comments
Closed

Code action error with diagnostic #1433

Gitfz810 opened this issue May 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Gitfz810
Copy link

Gitfz810 commented May 2, 2024

Describe the bug

Use 'o' to call code action with diagnostic failed.

image

Steps to reproduce

go version: 1.22.2
language_file:
main.go

package main

import (
	"fmt"
	"io/ioutil"
)

func mian() {
	_, err := ioutil.ReadFile("./file.txt")
	if err != nil {
		fmt.Println(err)
	}
}

saga.lua

return {
  "nvimdev/lspsaga.nvim",
  dependencies = {
    "nvim-treesitter/nvim-treesitter", -- optional
    "nvim-tree/nvim-web-devicons", -- optional
  },
  event = "BufReadPre",
  config = function()
    local setup, saga = pcall(require, "lspsaga")
    if not setup then
      return
    end

    saga.setup({
      -- when there has code action it will show a lightbulb
      lightbulb = {
        enable = false,
        sign = false,
      },
      beacon = {
        enable = false,
      },
      finder = {
        keys = {
          toggle_or_open = "<CR>",
          quit = "q",
          close = "<ESC>",
        },
      },
      rename = {
        in_select = false,
      },
      definition = {
        keys = {
          tabnew = "<C-c>n",
        },
      },
    })
  end,
}

Expected behavior

use code action success.

Neovim version (nvim -v)

NVIM v0.9.5

lspsaga commit

"lspsaga.nvim": { "branch": "main", "commit": "052234296f13e2705d5d290c7bd5a36d3dd81fde" }

Terminal name/version

terminal

@Gitfz810 Gitfz810 added the bug Something isn't working label May 2, 2024
@Miguerfi
Copy link

try comment this section on your lspsaga:

api.nvim_create_autocmd('CursorMoved', {
    buffer = self.action_bufnr,
    callback = function()
      self:set_cursor(tuples)
    end,
  })

/.local/share/nvim/lazy/lspsaga.nvim/lua/lspsaga/codeaction/init.lua

@glepnir
Copy link
Member

glepnir commented May 26, 2024

please update plugin first... your version too old

@glepnir glepnir closed this as completed May 26, 2024
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

3 participants