telescope-ui-select.nvim
telescope-ui-select.nvim copied to clipboard
codeactions specific config
Hi there! Thanks for your work!
I'm trying to set a specific setup for codeactions while leaving the rest as default.
So withing Telescope's extensions table, the ui-select config looks like this:
["ui-select"] = {
layout_strategy = "cursor",
layout_config = { width = 0.4, height = 0.3 },
on_complete = {
function()
vim.cmd("stopinsert")
end
}
}
Is there any way I could use that config but only for codeactions, while leaving the rest of the popups as they are?
I've tried following the Readme but I can't quite figure it out :thinking:
There is no way for vim.ui.select to know that it has been called from a code actions function. A potential workaround could be to map your codeactions key map to a custom function that would be wrapping codeactions.
Something along these lines may work, I haven't tested.
local function setup_telescope() --[[ require('telescope').setup({ regular_config })
local function setup_custom_telescope() --[[ require('telescope').setup({ config_from_example + on_complete_call_setup_telescope })]] end
function custom_codeactions()
setup_custom_telescope()
vim.lsp.buf.code_action()
end