hover.nvim
hover.nvim copied to clipboard
Rust and Cargo.toml providers?
I currently have a textDocument/hover handler that looks like this:
function M.hover()
if vim.bo.filetype == "rust" then
require("rust-tools.hover_actions").hover_actions()
elseif vim.fn.expand("%:t", false, false) == "Cargo.toml" then
require("crates").show_popup()
else
require("hover").hover()
require("autocommands")("DisableCursorHold")(function(autocmd)
vim.opt.eventignore:append("CursorHold")
autocmd(
{ "CursorMoved", "CursorMovedI", "BufHidden", "InsertCharPre" },
{ pattern = "<buffer>", once = true, desc = "Prevent floating diagnostic from opening while hover is opened." },
function()
vim.opt.eventignore:remove("CursorHold")
end
)
end)
end
end
And wanted to see about making both the rust-tools.nvim and crates.nvim actions be hover.nvim providers. However, both of these manage their own popup windows.
Any ideas here, or should I continue with this approach?
Thanks
You would need to deconstruct the functions so you can populate the windows manually via a provider.