stevearc / dressing.nvim

Neovim plugin to improve the default vim.ui interfaces
MIT License
1.69k stars 32 forks source link

(select) Telescope code actions failed #140

Closed AlejandroSuero closed 5 months ago

AlejandroSuero commented 5 months ago

Describe the bug When I use code actions to open the available ones I get the following error

Error executing vim.schedule lua callback: ...vim/lazy/dressing.nvim/lua/dressing/select/telescope.lua:29: attempt to index field 'ctx' (a nil value)
stack traceback:
        ...vim/lazy/dressing.nvim/lua/dressing/select/telescope.lua:29: in function <...vim/lazy/dressing.nvim/lua/dressing/select/telescope.lua:8>
        ...vim/lazy/dressing.nvim/lua/dressing/select/telescope.lua:137: in function 'select'
        ...are/nvim/lazy/dressing.nvim/lua/dressing/select/init.lua:74: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

System information

return {
  "stevearc/dressing.nvim",
  event = "VeryLazy",
  config = true,
}

with or without config = true, still errors

-- Paste your call to require("dressing").setup(...) in here

To Reproduce Steps to reproduce the behavior:

  1. Go to a diagnostic that requires a code action
    • In my case:
-- some code
file = io.open(options, "w")
file:write(new_content) -- Diagnostic: Need check nil
file:close() -- Diagnostic: Need check nil
-- more code
  1. Use vim.lsp.buf.code_action
  2. Errors

If possible, provide a minimal file that will trigger the issue (see tests/manual for examples of short ways to call vim.ui.*):

minimal code here

Screenshots If applicable, add screenshots to help explain your problem.

image

image

image

Also in a .c file:

image

image

Additional context On Windows11 (my host machine) seems to be working fine

AlejandroSuero commented 5 months ago

An update on the issue

My host machine Windows11 has the version v0.9.2.

In my Ubuntu on WSL with the v0.10.0 if I introduce the vim.ui.select from the nvim docs.

     vim.ui.select({ 'tabs', 'spaces' }, {
         prompt = 'Select tabs or spaces:',
         format_item = function(item)
             return "I'd like to choose " .. item
         end,
     }, function(choice)
         if choice == 'spaces' then
             vim.o.expandtab = true
         else
             vim.o.expandtab = false
         end
     end)

It shows the select window properly.

image

stevearc commented 5 months ago

What is the specific version of Neovim where you see this issue? I am unable to repro using NVIM v0.10.0-dev-2143+g3f188bc53. Also double check that you are on the most recent version of dressing.nvim

AlejandroSuero commented 5 months ago

My version of Neovim where the issue ocurres is NVIM v0.10.0-dev-619+gf771d6247

I just lazy synced and my current dressing version is the one attached to 7237cdf and still has the same issue.

I will update Neovim and see if happens.

AlejandroSuero commented 5 months ago

I updated to the latest version NVIM v0.10.0-dev-2143+g3f188bc53

Now seems to be working perfectly fine.