mirror of
https://github.com/neovim/neovim
synced 2025-07-18 02:01:46 +00:00
feat(lsp): use vim.ui.select() in codelenses (#16004)
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com> Mathias Fußenegger <mfussenegger@users.noreply.github.com>
This commit is contained in:
@ -91,16 +91,16 @@ function M.run()
|
|||||||
local option = options[1]
|
local option = options[1]
|
||||||
execute_lens(option.lens, bufnr, option.client)
|
execute_lens(option.lens, bufnr, option.client)
|
||||||
else
|
else
|
||||||
local options_strings = {"Code lenses:"}
|
vim.ui.select(options, {
|
||||||
for i, option in ipairs(options) do
|
prompt = 'Code lenses:',
|
||||||
table.insert(options_strings, string.format('%d. %s', i, option.lens.command.title))
|
format_item = function(option)
|
||||||
end
|
return option.lens.command.title
|
||||||
local choice = vim.fn.inputlist(options_strings)
|
end,
|
||||||
if choice < 1 or choice > #options then
|
}, function(option)
|
||||||
return
|
if option then
|
||||||
end
|
execute_lens(option.lens, bufnr, option.client)
|
||||||
local option = options[choice]
|
end
|
||||||
execute_lens(option.lens, bufnr, option.client)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user