mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CodeCompletion] Introduce "Flair" in code completion
To describe fine grained priorities. Introduce 'CodeCompletionFlair' that is a set of more descriptive flags for prioritizing completion items. This aims to replace ' SemanticContextKind::ExpressionSpecific' which was a "catch all" prioritization flag.
This commit is contained in:
@@ -226,9 +226,10 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
|
||||
}
|
||||
|
||||
CodeCompletionResult *result = nullptr;
|
||||
CodeCompletionFlair Flair;
|
||||
if (kind == CodeCompletionResult::Declaration) {
|
||||
result = new (*V.Sink.Allocator) CodeCompletionResult(
|
||||
context, /*IsArgumentLabels=*/false, numBytesToErase, string,
|
||||
context, Flair, /*IsArgumentLabels=*/false, numBytesToErase, string,
|
||||
declKind, isSystem, moduleName, notRecommended, briefDocComment,
|
||||
copyArray(*V.Sink.Allocator, ArrayRef<StringRef>(assocUSRs)),
|
||||
copyArray(*V.Sink.Allocator,
|
||||
@@ -236,7 +237,7 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
|
||||
CodeCompletionResult::Unknown, opKind);
|
||||
} else {
|
||||
result = new (*V.Sink.Allocator)
|
||||
CodeCompletionResult(kind, context, /*IsArgumentLabels=*/false,
|
||||
CodeCompletionResult(kind, context, Flair, /*IsArgumentLabels=*/false,
|
||||
numBytesToErase, string,
|
||||
CodeCompletionResult::NotApplicable, opKind);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user