nvim-telescope / telescope-ui-select.nvim

MIT License
774 stars 18 forks source link

feat: select specific code #7

Closed Conni2461 closed 2 years ago

Conni2461 commented 2 years ago

close #6 close #10

Conni2461 commented 2 years ago

CC @fdschmidt93 how crazy is this? It works for code_actions gives us the same displaying as current telescope version. And it still works with the example provided in the vim.ui.select 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)
axieax commented 2 years ago

image

Thanks for the quick changes! I seem to get this error with :lua vim.lsp.buf.code_action() though.

Conni2461 commented 2 years ago

I force pushed over this branch a couple of times. Make sure your checked out revision is: a41c612bb899af07f5949c48ec384d54a01910b9

If it still happens on that revision can you provide a few steps to reproduce?

axieax commented 2 years ago

Yep that's the version I'm using! Not sure, I'm literally just running that vim.lsp.buf.code_action() command. Telescope's code_action seems to inject some additional parameters (perhaps idx is missing) in the results returned from the LSP.

Conni2461 commented 2 years ago

my bad. Its fixed now

axieax commented 2 years ago

Oh nice works great for code actions now thanks! However, it seems to break normal vim.ui.select though (non-code-action).

image

Conni2461 commented 2 years ago

okay should also be fixed

axieax commented 2 years ago

Yep thank you so much for the quick changes :))