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:
Josa Gesell
2021-10-18 20:52:22 +02:00
committed by GitHub
parent bd2f61c6c4
commit e7ea54a3df

View File

@ -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