-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Sema] Hide underscored names from typo-correction #20125
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
[Sema] Hide underscored names from typo-correction #20125
Conversation
We already have something similar in code completion -- should we share the logic between the two instead of adding new rules? |
I was looking into the code completion side of things as well, but wasn't sure where that logic was located. Are you thinking there's existing logic around leading-underscore names that could be reused here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Anything else needed here? |
@swift-ci Please test. |
Build failed |
That's definitely your failure to fix. |
Build failed |
0d4e1f9
to
45939f5
Compare
Identifiers with a leading underscore are now hidden from typo-correction unless the typed name also begins with an underscore.
45939f5
to
9d23ba2
Compare
@adamshin It looks like code completion calls Decl::isPrivateStdlibDecl(), which has a number of checks in addition to leading underscore. Can you try using that instead? |
Sorry, I was the one who wrote up the bug this way. We don't want to use |
@swift-ci Please test |
Build failed |
Looks like my changes broke a test (Parse/recovery.swift). I'm looking into that now. |
Build failed |
The unresolved identifier 'esp' used to have '_exp' as a typo-correction option. That's no longer the case, and the type checker now singles out 'test' as the unique correction.
@swift-ci Please test. |
Build failed |
Build failed |
Failure looks unrelated; let's try again. @swift-ci Please test Linux |
Thanks, Adam! |
Identifiers with a leading underscore are now hidden from typo-correction unless the typed name also begins with an underscore.
Resolves SR-9083.