mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CodeCompletion] Make Void-returning functions "NotRecommended" in typed context
When we know we're expecting an expression that returns a value, make the completion "NotRecommended" to deprioritize it. rdar://problem/22810741
This commit is contained in:
@@ -899,6 +899,9 @@ CodeCompletionResult *CodeCompletionResultBuilder::takeResult() {
|
||||
typeRelation =
|
||||
calculateMaxTypeRelationForDecl(AssociatedDecl, ExpectedDeclTypes);
|
||||
|
||||
if (typeRelation == CodeCompletionResult::Invalid)
|
||||
IsNotRecommended = true;
|
||||
|
||||
return new (*Sink.Allocator) CodeCompletionResult(
|
||||
SemanticContext, NumBytesToErase, CCS, AssociatedDecl, ModuleName,
|
||||
/*NotRecommended=*/IsNotRecommended,
|
||||
|
||||
Reference in New Issue
Block a user