Skip to content

make vim-rustcexplain work with trouble.nvim #3

Description

@dlyongemallo

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions