-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Description
Currently, typo correction has very little intelligence about the context of the typo being corrected. As a result, we fail to suggest corrections as well as we could. For example:
This case fails to recognize we're in a context where we expect one of a handful of keywords:
struct S {
S() = defaul;
};
https://godbolt.org/z/o4snPEGve
(The same applies in many other circumstances; we should have a general mechanism that filters keywords by context.)
This case fails to recognize a type is invalid (but only in C) and suggests we replace lock
by long
:
void func() {
long x;
x = (lock);
}
https://godbolt.org/z/cxbjbE1bP
This case fails to recognize that only a type is valid:
int lang;
int main() {
(void)(ling)12;
}
https://godbolt.org/z/hc3rnrbKz
I expect more examples exist. The thrust of the request is to make typo correction a bit more situationally aware whenever possible.