Open stanciuadrian opened 3 years ago
The first quickfix is emitted by rustc which only renames the item, the second one is the one from rust-analyzer which fixed the usages. We should make it clearer that the former isn't the quickfix one should be using.
Afaik we've already started excluding the rustc quickfixes for what we have a decent alternative? At least that should be the endgoal anyway, so we might just filter that one out too.
I don't think we are filtering them yet, unless I missed that
Indeed, the Cargo messages are skipped, not the rustc ones now:
We should implement "prefer our fixes to rustc" logic.
I think the steps are:
I would like to try my hand at this.
Okay, I've looked around a bit.
It appears that diagnostics-related code is spread about various crates:
So I'm not exactly sure what a good place would be to assign check codes (from rustc or clippy) to our diags. And it appears that in some cases (like this one) there are multiple rustc lints covered by a single native diag. So it may make more sense to have a central map of (check diag code => native diag code) somewhere (rust_analyzer crate probably?).
In fact, I'm wondering if we could just have a list of "covered fixes" where, if it's known that native diags cover the fix, we just discard it without checking if a fix was actually provided by native diags. That wouldn't cover a case where a check fix is provided but the native diag misses the fix, but I have no idea how common such a case is.
Input:
2 fixes are suggested:
The first one renames the binding and misses the reference.
The second one works fine.