mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Parse][CodeCompletion] Completions for precedencegroup decls
Added the 'Module::getPrecedenceGroups' API to separate precedence group lookup from 'Module::lookupVisibleDecls', which together with 'FileUnit::lookupVisibleDecls', to which the former is forwarded, are expected to look up only 'ValueDecl'. In particular, this prevents completions like Module.PrecedenceGroup.
This commit is contained in:
@@ -2006,6 +2006,17 @@ void ModuleFile::getTopLevelDecls(SmallVectorImpl<Decl *> &results) {
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleFile::getPrecedenceGroups(
|
||||
SmallVectorImpl<PrecedenceGroupDecl*> &results) {
|
||||
PrettyStackTraceModuleFile stackEntry(*this);
|
||||
if (PrecedenceGroupDecls) {
|
||||
for (auto entry : PrecedenceGroupDecls->data()) {
|
||||
for (auto item : entry)
|
||||
results.push_back(cast<PrecedenceGroupDecl>(getDecl(item.second)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ModuleFile::getLocalTypeDecls(SmallVectorImpl<TypeDecl *> &results) {
|
||||
PrettyStackTraceModuleFile stackEntry(*this);
|
||||
|
||||
Reference in New Issue
Block a user