I use the Trouble plugin for neovim to edit Rust code. One of its features is a pretty diagnostics list. It would be nice to be able to use vim-rustcexplain to show help on the error shown in the current line:

I've currently implemented a hack which calls RustcExplain, but this requires moving the cursor to the error code.
vim.keymap.set("n", "<LocalLeader>e", function()
vim.cmd([[
let errcode=expand("<cword>")
exec "RustcExplain " . errcode
]])
end)
It would be much nicer to be able to do this from anywhere on the line, but a direct call to rustcexplain#OpenExplainPopup() results in no error code found.
I use the Trouble plugin for neovim to edit Rust code. One of its features is a pretty diagnostics list. It would be nice to be able to use vim-rustcexplain to show help on the error shown in the current line:
I've currently implemented a hack which calls
RustcExplain, but this requires moving the cursor to the error code.It would be much nicer to be able to do this from anywhere on the line, but a direct call to
rustcexplain#OpenExplainPopup()results inno error code found.