Merge pull request #82464 from a7medev/feat/full-documentation-in-code-completion

[IDE] Add full documentation to code completion result
This commit is contained in:
Ahmed Elrefaey
2025-09-04 12:06:21 +03:00
committed by GitHub
parent a1d18cfb1e
commit 1bc96857a8
56 changed files with 1426 additions and 281 deletions

View File

@@ -102,6 +102,7 @@ static void swiftCodeCompleteImpl(
CompletionContext.setIncludeObjectLiterals(opts.includeObjectLiterals);
CompletionContext.setAddInitsToTopLevel(opts.addInitsToTopLevel);
CompletionContext.setAddCallWithNoDefaultArgs(opts.addCallWithNoDefaultArgs);
CompletionContext.setVerifyUSRToDecl(opts.verifyUSRToDecl);
Lang.performWithParamsToCompletionLikeOperation(
UnresolvedInputFile, Offset, /*InsertCodeCompletionToken=*/true, Args,
@@ -728,6 +729,7 @@ static void translateCodeCompletionOptions(OptionsDictionary &from,
static UIdent KeyPopularityBonus("key.codecomplete.sort.popularitybonus");
static UIdent KeyAnnotatedDescription("key.codecomplete.annotateddescription");
static UIdent KeyIncludeObjectLiterals("key.codecomplete.includeobjectliterals");
static UIdent KeyVerifyUSRToDecl("key.codecomplete.verifyusrtodecl");
from.valueForOption(KeySortByName, to.sortByName);
from.valueForOption(KeyUseImportDepth, to.useImportDepth);
@@ -753,6 +755,7 @@ static void translateCodeCompletionOptions(OptionsDictionary &from,
from.valueForOption(KeyTopNonLiteral, to.showTopNonLiteralResults);
from.valueForOption(KeyAnnotatedDescription, to.annotatedDescription);
from.valueForOption(KeyIncludeObjectLiterals, to.includeObjectLiterals);
from.valueForOption(KeyVerifyUSRToDecl, to.verifyUSRToDecl);
}
/// Canonicalize a name that is in the format of a reference to a function into
@@ -914,7 +917,8 @@ static void transformAndForwardResults(
CodeCompletionDiagnosticSeverity::None,
/*DiagnosticMessage=*/"");
auto *paren = new (innerSink.allocator) CodeCompletion::SwiftResult(
*contextFreeResult, SemanticContextKind::CurrentNominal,
*contextFreeResult, /*DeclOrCtx=*/nullptr,
SemanticContextKind::CurrentNominal,
CodeCompletionFlairBit::ExpressionSpecific,
exactMatch ? exactMatch->getNumBytesToErase() : 0,
CodeCompletionResultTypeRelation::Unrelated,