Skip to content

make vim-rustcexplain work with trouble.nvim #3

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

Open
dlyongemallo opened this issue Jun 14, 2024 · 1 comment
Open

make vim-rustcexplain work with trouble.nvim #3

dlyongemallo opened this issue Jun 14, 2024 · 1 comment

Comments

@dlyongemallo
Copy link

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:

Screenshot from 2024-06-14 09-43-49

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.

@yining
Copy link
Owner

yining commented Jun 18, 2024

hi @dlyongemallo

I will get back to you on this soon.

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