mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CodeComplete] Show global completions from modules that are imported as @_spi
If a module is imported as `@_spi`, we didn’t receive any global completions from it. rdar://99027179
This commit is contained in:
@@ -484,6 +484,12 @@ static std::string getName(StringRef cacheDirectory,
|
||||
<< (K.AddInitsInToplevel ? "-inits" : "")
|
||||
<< (K.AddCallWithNoDefaultArgs ? "-nodefaults" : "")
|
||||
<< (K.Annotated ? "-annotated" : "");
|
||||
if (K.SpiGroups.size() > 0) {
|
||||
OSS << "-spi";
|
||||
for (auto SpiGroup : K.SpiGroups) {
|
||||
OSS << "-" << SpiGroup;
|
||||
}
|
||||
}
|
||||
|
||||
// name[-access-path-components]
|
||||
for (StringRef component : K.AccessPath)
|
||||
@@ -548,9 +554,16 @@ OnDiskCodeCompletionCache::getFromFile(StringRef filename) {
|
||||
return None;
|
||||
|
||||
// Make up a key for readCachedModule.
|
||||
CodeCompletionCache::Key K{filename.str(), "<module-name>", {},
|
||||
false, false, false,
|
||||
false, false, false};
|
||||
CodeCompletionCache::Key K{/*ModuleFilename=*/filename.str(),
|
||||
/*ModuleName=*/"<module-name>",
|
||||
/*AccessPath=*/{},
|
||||
/*ResultsHaveLeadingDot=*/false,
|
||||
/*ForTestableLookup=*/false,
|
||||
/*ForPrivateImportLookup=*/false,
|
||||
/*SpiGroups=*/{},
|
||||
/*AddInitsInToplevel=*/false,
|
||||
/*AddCallWithNoDefaultArgs=*/false,
|
||||
/*Annotated=*/false};
|
||||
|
||||
// Read the cached results.
|
||||
auto V = CodeCompletionCache::createValue();
|
||||
|
||||
Reference in New Issue
Block a user