Skip to content

[5.3][CodeCompletion] Force apply a viable solution even if ambiguous #32650

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jul 1, 2020

  • Explanation: This is a 5.3 only workaround for the issue where code completion fails to suggest member completions for function builder closure parameters. Added a ConstraintSystem flag to force apply a solution even if there are multiple viable solutions, so that code completion can see a possible type in the type-checked AST. Enable the flag for member completions. This is not a ideal solution because the solution applied is not predictable. But still it's better than nothing.
  • Scope: Code completion on '.' after expressions
  • Risk: Low-Mid. The change affects code completion only, but it modifies the AST.
  • Testing: Added regression test cases
  • Issue: rdar://problem/64079439
  • Reviewer: Pavel Yaskevich (@xedin)

As a workaround for the issue where code completion fails to suggest
member completions for function builder closure parameters.

Added ConstraintSystem flag to force apply a solution even if there are
multiple viable solutions.

rdar://problem/64079439
@rintaro
Copy link
Member Author

rintaro commented Jul 1, 2020

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Jul 1, 2020

@swift-ci Please build toolchain macOS

@rintaro rintaro changed the title [CodeCompletion] Force apply a viable solution even if ambiguous [5.3][CodeCompletion] Force apply a viable solution even if ambiguous Jul 1, 2020
@rintaro rintaro added the r5.3 label Jul 1, 2020
@swift-ci
Copy link
Contributor

swift-ci commented Jul 1, 2020

macOS Toolchain
Download Toolchain
Git Sha - e6a3215

Install command
tar -zxf swift-PR-32650-535-osx.tar.gz --directory ~/

@rintaro rintaro marked this pull request as ready for review July 1, 2020 18:51
@rintaro rintaro requested a review from a team as a code owner July 1, 2020 18:51
Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as 5.3 only fix to improve code completion experience. We'll have a better solution for this on master.

@rintaro
Copy link
Member Author

rintaro commented Jul 1, 2020

@swift-ci Please nominate

@akyrtzi akyrtzi merged commit d2eca7e into swiftlang:release/5.3 Jul 1, 2020
@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.

5 participants