-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggested spelling correction seems off-base #72553
Comments
I debugged it a bit. The code to fix is likely in or around |
Thank you for investigating! Independent of what we do with different logogram sets (your suggestion sounds plausible), an edit distance of 2 for a string of length 2 should not meet the threshold for showing a suggestion, even within a single logogram set. |
I think edit distance of 1 for a string of length 1 is reasonable (a lot of existing UI tests relies on it), but maybe an edit distance of 2 for a string of length 2 is not reasonable indeed. As you point out, with regular chars, the edit distance is still 2 but |
rustc_span: Use correct edit distance start length for suggestions Otherwise the suggestions can be off-base for non-ASCII identifiers. For example suggesting that `Ok` is a name similar to `读文`. Closes rust-lang#72553.
rustc_span: Use correct edit distance start length for suggestions Otherwise the suggestions can be off-base for non-ASCII identifiers. For example suggesting that `Ok` is a name similar to `读文`. Closes rust-lang#72553.
Rollup merge of rust-lang#118381 - Enselic:edit-dist-len, r=WaffleLapkin rustc_span: Use correct edit distance start length for suggestions Otherwise the suggestions can be off-base for non-ASCII identifiers. For example suggesting that `Ok` is a name similar to `读文`. Closes rust-lang#72553.
In https://www.reddit.com/r/rust/comments/gpw2ra/how_is_the_rust_compiler_able_to_tell_the_visible/ I noticed this surprising spelling suggestion:
To me
读文
andOk
don't seem like they would be similar enough to meet the threshold for showing such a suggestion. Can we calibrate this better for short idents?For comparison, even
kO
doesn't assume you meanOk
.rustc 1.45.0-nightly (8970e8b 2020-05-23)
Mentioning @estebank who worked on suggestions most recently in #65421.
The text was updated successfully, but these errors were encountered: