Turn autoimport from an assist into a quickfix
Which will allow e.g. write!() to import when std::fmt::Write/std::io::Write are not in scope, but there is no explicit method call to trigger the assist on.
rust-analyzer already has an assist for that, https://rust-analyzer.github.io/book/assists.html#auto_import.
No it doesn't:
use std::fs::File;
fn main() {
let f = File::create("hello_world").unwrap();
write!(f, "hello world");
}
Error appears on f, no assist.
That's because it's a macro, and there is no explicit method invocation.
To do something here we would need to emit our own error, and it won't happen soon.
Is that a reason to leave this issue closed?
Even when we have the diagnostic it may prove unfeasible to have a quickfix for this macro.
But I can reopen the issue and edit it to clarify that we want to change the assist into a quickfix.