Even faster completion of root packages

This commit is contained in:
Valentin Kipyatkov
2015-07-15 22:06:33 +03:00
parent 136af1cd60
commit 16d503aed0
10 changed files with 19 additions and 16 deletions
@@ -204,8 +204,7 @@ class BasicCompletionSession(configuration: CompletionSessionConfiguration,
// getting root packages from scope is very slow so we do this in alternative way
if (isNoQualifierContext() && (completionKind.descriptorKindFilter?.kindMask ?: 0).and(DescriptorKindFilter.PACKAGES_MASK) != 0) {
//TODO: move this code somewhere else
//TODO: filter by prefix for better performance?
val packageNames = PackageIndexUtil.getSubPackageFqNames(FqName.ROOT, originalSearchScope, project)
val packageNames = PackageIndexUtil.getSubPackageFqNames(FqName.ROOT, originalSearchScope, project, prefixMatcher.asNameFilter())
.map { it.shortName() }
.toMutableSet()