mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CodeCompletion] Don't recommend functions with async alternatives in async contexts
When an function has an async alternative, that should be preferred when we are completing in an async context. Thus, the sync method should be marked as not recommended if the current context can handle async methods. rdar://88354910
This commit is contained in:
@@ -1168,7 +1168,8 @@ Completion *CompletionBuilder::finish() {
|
||||
contextFreeBase.getKind(),
|
||||
contextFreeBase.getOpaqueAssociatedKind(), opKind,
|
||||
contextFreeBase.isSystem(), contextFreeBase.isAsync(),
|
||||
newCompletionString, contextFreeBase.getModuleName(),
|
||||
contextFreeBase.hasAsyncAlternative(), newCompletionString,
|
||||
contextFreeBase.getModuleName(),
|
||||
contextFreeBase.getBriefDocComment(),
|
||||
contextFreeBase.getAssociatedUSRs(),
|
||||
contextFreeBase.getResultType(),
|
||||
|
||||
Reference in New Issue
Block a user