Closed
Description
In the process of writing some code, I didn't import an enum, resulting in
error[E0412]: cannot find type `AssignCommand` in this scope
--> parser/src/command.rs:61:48
|
61 | fn maybe_parse_review(&mut self) -> Option<AssignCommand<'a>> {
| ^^^^^^^^^^^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
1 | use crate::command::assign::AssignCommand;
|
help: you might be missing a type parameter
|
51 | impl<'a, AssignCommand> Input<'a> {
| ^^^^^^^^^^^^^^^
The import suggestion is great, but suggesting the type parameter seems likely to be confusing (and IMO, is almost certainly wrong). My suggested heuristic is to avoid suggesting the type parameter if we suggest a candidate in another module, at least, and possibly even avoid suggesting it always if there's more than on letter. It also seems suprising to suggest the type parameter on the impl and not the (more local) function?
I can try to come up with a MCVE, but I suspect it's pretty simple and I wanted to just not forget about this.