mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CodeCompletion] Compute InvalidAsyncContext warning when making a completion result contextual
Store whether a result is async in the `ContextFreeCodeCompletionResult` and determine whether an async method is used in a sync context when promoting the context free result to a contextual result. rdar://78317170
This commit is contained in:
@@ -910,6 +910,7 @@ static void transformAndForwardResults(
|
||||
ContextFreeCodeCompletionResult::createPatternOrBuiltInOperatorResult(
|
||||
innerSink.swiftSink, CodeCompletionResultKind::BuiltinOperator,
|
||||
completionString, CodeCompletionOperatorKind::None,
|
||||
/*IsAsync=*/false,
|
||||
/*BriefDocComment=*/"", CodeCompletionResultType::notApplicable(),
|
||||
ContextFreeNotRecommendedReason::None,
|
||||
CodeCompletionDiagnosticSeverity::None,
|
||||
@@ -919,6 +920,7 @@ static void transformAndForwardResults(
|
||||
CodeCompletionFlairBit::ExpressionSpecific,
|
||||
exactMatch ? exactMatch->getNumBytesToErase() : 0,
|
||||
/*TypeContext=*/nullptr, /*DC=*/nullptr, /*USRTypeContext=*/nullptr,
|
||||
/*CanCurrDeclContextHandleAsync=*/false,
|
||||
ContextualNotRecommendedReason::None);
|
||||
|
||||
SwiftCompletionInfo info;
|
||||
|
||||
Reference in New Issue
Block a user