I don’t think I’ve ever had a useful suggestion from this error message. Do others find it useful? Or annoying?
I’m talking about stuff like “error: unresolved name OK. Did you mean tys?” Where, the name I was looking for was Ok.
The suggestions are always wrong in my experience. In order to make this useful, I think we need to type check the suggestion to make sure it could work and have a better spell checker, especially for short words. That seems like a lot of work, in the meantime I would like to just turn it off.
I once wrote a spellchecker in Python (playing with VP trees) that used a modified Levenshtein distance: replacements had fractional distance which was based on the physical distance between the letters on the keyboard.
On the one hand, this meant it was frighteningly good at suggesting corrections for typos. It also, unfortunately, led to what I ended up calling “drunk typo” suggestions: words of the same length where every letter in the suggestion was very close to each letter in the input. Even with a pretty small dictionary, it was crazy how often it’d find them.
The suggestions are wrong with enough frequency that I have to think
"wait… what did I mean?" every time I see the "undeclared identifier"
error anyway. I don’t think a correct suggestion actually saves me any
time, but it does kind of feel nice when the compiler knows what you mean.
On that note a capitalization mistake could be a lower “edit” distance than a completely different letter because capitalization is very easy to get wrong. Maybe keys that are close together could have a lower edit distance than keys that are far apart.