rust-tools.nvim icon indicating copy to clipboard operation
rust-tools.nvim copied to clipboard

auto_focus option not working

Open Lisieshy opened this issue 3 years ago • 4 comments

I'm currently using AstroNvim Version v2.4.2.

My issue is that the auto_focus option doesn't do anything. I still have to call RustHoverActions twice for it to focus in the hover window.

I configured the rust-tools plugin using the official AstroNvim Documentation and added the tools.hover_actions.auto_focus to true.

Here is a snippet of my config (config.plugins.init)

  -- Configure plugins
  plugins = {
    init = {
      {
        "simrat39/rust-tools.nvim",
        after = { "mason-lspconfig.nvim" }, -- make sure to load after mason-lspconfig
        config = function()
          require("rust-tools").setup {
            server = astronvim.lsp.server_settings "rust_analyzer", -- get the server settings and built in capabilities/on_attach
            opts = {
              tools = {
                hover_actions = { auto_focus = true },
              },
            }
          }
        end,
      },

Did I forget anything in the setup process ?

Lisieshy avatar Oct 26 '22 01:10 Lisieshy

I'm getting the same in neovim 0.8

londospark avatar Oct 27 '22 01:10 londospark

same here in neovim 0.8

n3ry7 avatar Oct 29 '22 12:10 n3ry7

Is there any guaranteed reproduction? Seems to work fine for me

simrat39 avatar Nov 06 '22 04:11 simrat39

Natively, to configure auto_focus, you wanna move tools outside of your opts:

require("rust-tools").setup({
  ...
  tools = {
    hover_actions = {
      auto_focus = true,
    },
  },
})

Perhaps AstroNvim is not respecting this structure?

tobias-edwards avatar Dec 01 '23 02:12 tobias-edwards