[SourceKit] Compute code completion type relation when wrapping a ContextFreeCodeCompletionResult in a CodeCompletionResult

[CodeCompletion] Make ExpectedTypeContext a class with explicit getters/setters

This simplifies debugging because you can break when the possible types are set and you can also search for references to `setPossibleType` to figure out where the expected types are being set.
This commit is contained in:
Alex Hoppen
2022-01-14 16:27:31 +01:00
parent 50eafca5bf
commit 6bc0de94a2
13 changed files with 460 additions and 280 deletions

View File

@@ -923,14 +923,15 @@ static void transformAndForwardResults(
new (innerSink.allocator) ContextFreeCodeCompletionResult(
CodeCompletionResultKind::BuiltinOperator, completionString,
CodeCompletionOperatorKind::None,
/*BriefDocComment=*/"", ContextFreeNotRecommendedReason::None,
/*BriefDocComment=*/"", CodeCompletionResultType::notApplicable(),
ContextFreeNotRecommendedReason::None,
CodeCompletionDiagnosticSeverity::None,
/*DiagnosticMessage=*/"");
auto *paren = new (innerSink.allocator) CodeCompletion::SwiftResult(
*contextFreeResult, SemanticContextKind::CurrentNominal,
CodeCompletionFlairBit::ExpressionSpecific,
exactMatch ? exactMatch->getNumBytesToErase() : 0,
CodeCompletionResultTypeRelation::NotApplicable,
/*TypeContext=*/nullptr, /*DC=*/nullptr,
ContextualNotRecommendedReason::None,
CodeCompletionDiagnosticSeverity::None, /*DiagnosticMessage=*/"");