Skip to content

[5.3][CodeCompletion] Prioritize type matching overload for unresovled member #31343

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

Merged

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Apr 27, 2020

Cherry-pick of #31307 into release/5.3, originally reviewed by @benlangmuir

rdar://problem/62121221

For exmaple:

    func foo(_: Int, _: IntOption)
    func foo(_: Float, _: FloatOption)

    foo(intVal, .<HERE>)

Previously code completion suggests static member from 'IntOption' and
'FloatOption' without any prioritization. Prioritize members from
'IntOption' because the user probably wants to input them.

In such cases, 'CodeCompletionExpr' at the cursor position is
pre-typechecked to 'IntOption'. So mark results with matching type with
'ExprSpecific'.

rdar://problem/62121221
(cherry picked from commit e947512)
@rintaro rintaro added the r5.3 label Apr 27, 2020
@rintaro
Copy link
Member Author

rintaro commented Apr 27, 2020

@swift-ci Please test

@rintaro rintaro requested a review from akyrtzi April 27, 2020 19:16
@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1052160

@rintaro
Copy link
Member Author

rintaro commented Apr 27, 2020

@swift-ci Please test macOS

@rintaro rintaro merged commit 57dfd41 into swiftlang:release/5.3 Apr 28, 2020
@rintaro rintaro deleted the 5.3-ide-completion-rdar62121221 branch April 28, 2020 03:57
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants