aznhe21 / actions-preview.nvim

Fully customizable previewer for LSP code actions.
GNU General Public License v3.0
365 stars 9 forks source link

Error executing vim.schedule lua callback: .../backend/telescope.lua:150: Invalid 'replacement': Expected Lua table #44

Closed Parsifa1 closed 2 months ago

Parsifa1 commented 3 months ago

image

It seems something went wrong here...

when run require("actions-preview").code_actions , it occurs.

crisidev commented 2 months ago

I have the same issue and for me it comes with actions from none-ls, where preview is something like

{
  syntax = "",
  text = "Preview is not available for this action (command=NULL_LS_CODE_ACTION).\nThis is due to limitations of your language server (null-ls) implementation."
}
crisidev commented 2 months ago

I have roughly fixed it locally with something like this:

                if preview["text"] ~= nil then
                    lines = {}
                    for s in preview.text:gmatch("[^\r\n]+") do
                        table.insert(lines, s)
                    end
                    preview.lines = lines
                else
                    preview = preview or { syntax = "", lines = { "preview not available" } }
                end
Parsifa1 commented 2 months ago

I have roughly fixed it locally with something like this:

                if preview["text"] ~= nil then
                    lines = {}
                    for s in preview.text:gmatch("[^\r\n]+") do
                        table.insert(lines, s)
                    end
                    preview.lines = lines
                else
                    preview = preview or { syntax = "", lines = { "preview not available" } }
                end

maybe you can make a pr!

aznhe21 commented 2 months ago

Uh, sorry, I'll fix it right away; you don't have to give me a PR.

aznhe21 commented 2 months ago

Fixed in #45. Please check it.

Parsifa1 commented 2 months ago

Thanks for your quick response!

crisidev commented 2 months ago

Thanks a lot, unfortunately I did not have time to make a PR..