nvimdev / lspsaga.nvim

improve neovim lsp experience

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code Action Error: lspsaga.nvim/lua/lspsaga/codeaction/preview.lua:104: attempt to perform arithmetic on a table value

xfdj opened this issue · comments

Describe the bug

image

Steps to reproduce

My config:

return {
    -- LSP enhance experience
    {
        "nvimdev/lspsaga.nvim",
        event = "LspAttach",
        dependencies = {
            "nvim-tree/nvim-web-devicons",
            -- Please make sure you install markdown and markdown_inline parser
            "nvim-treesitter/nvim-treesitter",
        },
        keys = {
            -- LSP finder find the symbol definition implement reference
            { "<Leader>gf", "<Cmd>Lspsaga finder<CR>",      "n",                 desc = "[f]inder" },
            -- Code action
            { "<Leader>ga", "<Cmd>Lspsaga code_action<CR>", mode = { "n", "v" }, desc = "code [a]ction" },
            -- Rename
            { "<Leader>gr", "<Cmd>Lspsaga rename<CR>",      "n",                 desc = "[r]ename" },
            -- Rename word in whole project
            {
                "<Leader>gR",
                "<Cmd>Lspsaga rename ++project<CR>",
                "n",
                desc = "[R]ename in whole project",
            },
            -- hover doc
            { "<Leader>gh", "<Cmd>Lspsaga hover_doc<CR>",             "n", desc = "[h]over doc" },
            -- Peek Definition
            -- you can edit the definition file in this float window
            -- also support open/vsplit/etc operation check definition_action_keys
            -- support tagstack C-t jump back
            -- { "<Leader>gd",  "<Cmd>Lspsaga peek_definition<CR>",       "n" },
            -- Show line diagnostics
            -- you can pass argument ++unfocus to make show_line_diagnostics float window unfocus
            { "<Leader>gl", "<Cmd>Lspsaga show_line_diagnostics<CR>", "n", desc = "[l]ine diagnostics" },
            -- Toggle Outline
            { "<Leader>gs", "<Cmd>Lspsaga outline<CR>",               "n", desc = "[s]ymbol outline" },
            -- Float terminal
            -- { "<A-d>", "<Cmd>Lspsaga term_toggle<CR>", { "n", "t" } },
            -- Callhierarchy
            { "<Leader>gi", "<Cmd>Lspsaga incoming_calls<CR>",        "n", desc = "[i]ncoming calls" },
            { "<Leader>go", "<Cmd>Lspsaga outgoing_calls<CR>",        "n", desc = "[o]utgoing calls" },
            -- Diagnostic jump
            -- You can use <C-o> to jump back to your previous location
            { "[d",         "<Cmd>Lspsaga diagnostic_jump_prev<CR>",  "n", desc = "Previous [d]iagnostic" },
            { "]d",         "<Cmd>Lspsaga diagnostic_jump_next<CR>",  "n", desc = "Next [d]iagnostic" },
            -- Diagnostic jump with filters such as only jumping to an error
            {
                "[e",
                function()
                    require("lspsaga/diagnostic"):goto_prev({ severity = vim.diagnostic.severity.ERROR })
                end,
                "n",
                desc = "Previous [e]rror",
            },
            {
                "]e",
                function()
                    require("lspsaga/diagnostic"):goto_next({ severity = vim.diagnostic.severity.ERROR })
                end,
                "n",
                desc = "Next [e]rror",
            },
        },
        config = function()
            require("lspsaga").setup({
                -- Customizing Lspsaga's Appearance
                ui = {
                    -- this option only work in neovim 0.9
                    border = require("config/options").border,
                    winblend = 0,
                    expand = "瞽?,
                    collapse = "瞽?,
                    preview = "瞵?,
                    code_action = "瞟?,
                    diagnostic = "飭?,
                    incoming = "町?,
                    outgoing = "町?,
                    kind = {},
                },
                -- options for each command
                -- same as nvim-lightbulb but async
                lightbulb = {
                    enable = true,
                    sign = true,
                    virtual_text = false,
                    debounce = 1000,
                    sign_priority = 40,
                },
                finder = {
                    default = "def+tyd+imp+ref",
                    methods = {
                        tyd = "textDocument/typeDefinition",
                    },
                    keys = {
                        vsplit = "v",
                        split = "s",
                    },
                },
                code_action = {
                    show_server_name = true,
                    extend_gitsigns = true,
                    keys = {
                        quit = "q",
                        exec = "<CR>",
                    },
                },
                definition = {
                    edit = "<C-c>o",
                    vsplit = "<C-c>v",
                    split = "<C-c>i",
                    tabe = "<C-c>t",
                    quit = "q",
                },
                rename = {
                    quit = "<Esc>",
                    in_select = true,
                },
                symbol_in_winbar = {
                    enable = false,
                    separator = "飸?",
                },
                -- show outline
                outline = {},
            })
        end,
    },
}

Expected behavior

Neovim version (nvim -v)

NVIM v0.10.0-dev-2135+g98a4ed0a1 Build type: RelWithDebInfo LuaJIT 2.1.1703358377

lspsaga commit

9a06eaf

Terminal name/version

Windows Terminal 1.19.10821.0