Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codeactions specific config #16

Open
EricDriussi opened this issue Nov 11, 2022 · 1 comment
Open

codeactions specific config #16

EricDriussi opened this issue Nov 11, 2022 · 1 comment

Comments

@EricDriussi
Copy link

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 🤔

@antonk52
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants