Do not force loading all kt-files inside LazyPackageDescriptor constructor

Effectively it leads to all stubs being built for any once used package

The idea is that they only were used for FILE_TO_PACKAGE_FRAGMENT
that is mostly read in backend and rarely in the IDE, so we can replace
its usages with searching through related package-fragments
This commit is contained in:
Denis Zharkov
2017-11-23 17:45:57 +03:00
parent d655c4075c
commit ac56965a99
15 changed files with 80 additions and 40 deletions
@@ -109,6 +109,10 @@ class StubBasedPackageMemberDeclarationProvider(
return PackageIndexUtil.findFilesWithExactPackage(fqName, searchScope, project)
}
override fun containsFile(file: KtFile): Boolean {
return searchScope.contains(file.virtualFile ?: return false)
}
override fun getTypeAliasDeclarations(name: Name): Collection<KtTypeAlias> {
return KotlinTopLevelTypeAliasFqNameIndex.getInstance().get(childName(name), project, searchScope)
}