[CodeCompletion] Lazily compute contextual diagnostics

This commit is contained in:
Alex Hoppen
2022-07-21 14:19:48 +02:00
parent 341bc34fe8
commit 9fc850abed
12 changed files with 145 additions and 137 deletions

View File

@@ -142,8 +142,7 @@ bool SourceKit::CodeCompletion::addCustomCompletions(
*contextFreeResult, SemanticContextKind::Local,
CodeCompletionFlairBit::ExpressionSpecific,
/*NumBytesToErase=*/0, /*TypeContext=*/nullptr, /*DC=*/nullptr,
/*USRTypeContext=*/nullptr, ContextualNotRecommendedReason::None,
CodeCompletionDiagnosticSeverity::None, /*DiagnosticMessage=*/"");
/*USRTypeContext=*/nullptr, ContextualNotRecommendedReason::None);
CompletionBuilder builder(sink, *swiftResult);
builder.setCustomKind(customCompletion.Kind);
@@ -1173,8 +1172,8 @@ Completion *CompletionBuilder::finish() {
contextFreeBase.getResultType(),
contextFreeBase.getNotRecommendedReason(),
contextFreeBase.getDiagnosticSeverity(),
contextFreeBase.getDiagnosticMessage(),
newFilterName);
contextFreeBase.getDiagnosticMessage(), newFilterName,
contextFreeBase.getNameForDiagnostics());
newBase = base.withContextFreeResultSemanticContextAndFlair(
*contextFreeResult, semanticContext, flair, sink.swiftSink);
}