Skip to content

[CS] Avoid penalizing holes for placeholder vars for completion #79217

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
merged 2 commits into from
Feb 8, 2025

Conversation

hamishknight
Copy link
Contributor

When doing completion in a result builder, we avoid solving unrelated expressions by replacing them with unbound placeholder variables. Avoid penalizing assigning holes to these placeholders, since otherwise we can end up unnecessarily exploring the entire solution space, and bailing due to too complex.

Resolves #79213
rdar://144382123

When doing completion in a result builder, we avoid
solving unrelated expressions by replacing them with
unbound placeholder variables. Avoid penalizing
assigning holes to these placeholders, since
otherwise we end up unnecessarily exploring the
entire solution space, and bailing due to too
complex.

rdar://144382123
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please SourceKit stress test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Nice find

@hamishknight
Copy link
Contributor Author

@swift-ci please test Windows

@hamishknight hamishknight merged commit 860d68e into swiftlang:main Feb 8, 2025
5 of 6 checks passed
@hamishknight hamishknight deleted the hole-in-one branch February 8, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completion returns empty result in result builder else if block
3 participants