Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

(select) Telescope code actions failed #140

Closed
AlejandroSuero opened this issue Jan 20, 2024 · 4 comments
Closed

(select) Telescope code actions failed #140

AlejandroSuero opened this issue Jan 20, 2024 · 4 comments
Assignees
Labels
bug Something isn't working P0 Highest priority, will receive attention

Comments

@AlejandroSuero
Copy link

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

  • OS: [ubuntu on WSL]
  • Neovim version: v0.10.0
  • Is this related to a specific vim.ui.select backend? If so, which one? Telescope
  • Dressing config: with lazy.nvim
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 AlejandroSuero added the bug Something isn't working label Jan 20, 2024
@AlejandroSuero
Copy link
Author

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 stevearc added the P0 Highest priority, will receive attention label Jan 21, 2024
@stevearc
Copy link
Owner

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

@stevearc stevearc added the question Further information is requested label Jan 21, 2024
@AlejandroSuero
Copy link
Author

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.

@github-actions github-actions bot removed the question Further information is requested label Jan 21, 2024
@AlejandroSuero
Copy link
Author

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

Now seems to be working perfectly fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working P0 Highest priority, will receive attention
Projects
None yet
Development

No branches or pull requests

2 participants