Hacker News new | ask | show | jobs
by revskill 1254 days ago
Is there any tool in Rust that allows auto import module based on usage ? A VSCode extension is perfect.
2 comments

Rust Analyzer can add `use` statements on confirming completion and clippy will complain/remove unused ones, if that's what you want.
When a symbol is unresolved, but could be made available in the current workspace -- e.g., HashMap when you haven't yet imported it, or a trait function whose trait isn't in scope -- rust-analyzer offers to import or qualify the symbol or import the necessary trait.