-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CodeCompletion] Report type relations when completing inside result builders #42210
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
[CodeCompletion] Report type relations when completing inside result builders #42210
Conversation
c37d627
to
1f84ca5
Compare
@swift-ci Please smoke test |
@swift-ci Please SourceKit stress test |
lib/Sema/ConstraintSystem.cpp
Outdated
// it. Look for a ArgumentConversion constraint that allows us to retrieve | ||
// the argument type var. | ||
for (auto argConstraint : CS.getConstraintGraph().gatherConstraints( | ||
typeVar, ConstraintGraph::GatheringKind::AllMentions)) { |
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.
I think you don't need AllMentions
in this case or the latter one EquivalenceClass
should be sufficient because the constraint in question is associated directly with the type variable the search is performed for.
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.
Actually it might even be enough to just iterate over direct constraints in both cases via ConstraintGraphNode::getConstraints()
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.
solveForCodeCompletion
changes look good! I left a comment that would be good to address before this is merged.
…completion We record fixes while solving normal expressions for code completion and we should do the same when solving result builders if we are reporting the solutions to completion callbacks.
Helped me while debugging and might help others as well.
…builders This requires navigating the constraint system solution to retrieve the argument type of the `buildBlock` call. The comments in the code should describe what I’m doing well enough. rdar://83846531
1f84ca5
to
0b9644a
Compare
@swift-ci Please smoke test |
@swift-ci Please SourceKit stress test |
This requires navigating the constraint system solution to retrieve the argument type of the
buildBlock
call. The comments in the code should describe what I’m doing.rdar://83846531