Just trying to use rust-analyzer in vim, specifically for the auto-importing functionality. It seems like according to the assists documentation, if I have an unresolved name, then I should be able to get a prompt from rust-analyzer to add an import. So I type something like
let x = Transform::new(), then bring up the language server actions, but I only see "Extract into variable" and "Implement default members", when I would hope to get a suggestion to import from
amethyst::core::Transform. Any help would be much appreciated! Also hopefully creating a topic is the way to go for this, first time zulip-er
Can you try in an empty project, just to make sure it's not related to Amethyst? Importing something like
HashMap should work fine.
I was unable to get this to work (none of the import-related functionality works for me) in vim and coc.nvim. I haven't had the time to investigate...
I only tested it in LanguageClient-neovim
Autoimport works when using coc.nvim and coc-rust-analyzer, but the default behaviour of
coc-codeaction was changed recently to apply to the whole buffer, and rust-analyzer only offers assists if the selection is specific enough.
See https://github.com/fannheyward/coc-rust-analyzer/pull/252#issuecomment-632427338 and https://github.com/neoclide/coc.nvim/issues/1981
If you have a binding to
<Plug>(coc-codeaction), you probably want to change it to call
v<Plug>(coc-codeaction-selected) for now
will try that, thanks!