mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CodeCompletion] Don't check 'InvalidAsyncContext' for imported globals
'InvalidAsyncContext' depends on the decl context. That may case "sticky" not-recommended If it's cached for a non-async context. To workaround this, stop checking 'InvalidAsyncContext' when collecting completion items for caching. Also consistently use the 'SourceFile' as the decl context to avoid decl context specific behavior. rdar://78315441
This commit is contained in:
@@ -342,6 +342,10 @@ static void writeCachedModule(llvm::raw_ostream &out,
|
||||
endian::Writer LE(results, little);
|
||||
for (CodeCompletionResult *R : V.Sink.Results) {
|
||||
assert(!R->isArgumentLabels() && "Argument labels should not be cached");
|
||||
assert(R->getNotRecommendedReason() !=
|
||||
CodeCompletionResult::NotRecommendedReason::InvalidAsyncContext &&
|
||||
"InvalidAsyncContext is decl context specific, cannot be cached");
|
||||
|
||||
// FIXME: compress bitfield
|
||||
LE.write(static_cast<uint8_t>(R->getKind()));
|
||||
if (R->getKind() == CodeCompletionResult::Declaration)
|
||||
|
||||
Reference in New Issue
Block a user