Added tests, and fixed some bugs using it

This commit is contained in:
Simon Ogorodnik
2016-08-15 13:53:23 +03:00
committed by Valentin Kipyatkov
parent 251d87fd22
commit 939b4768f5
10 changed files with 320 additions and 3 deletions
@@ -217,15 +217,15 @@ class KotlinIndicesHelper(
fun getKotlinStatics(name: String): Collection<DeclarationDescriptor> {
return sequenceOf(KotlinFunctionShortNameIndex.getInstance().get(name, project, scope),
KotlinPropertyShortNameIndex.getInstance().get(name, project, scope)).
flatMap { it.asSequence() }
KotlinPropertyShortNameIndex.getInstance().get(name, project, scope))
.flatMap { it.asSequence() }
.mapNotNull {
when (it) {
is KtNamedFunction -> it.descriptor
is KtProperty -> it.descriptor
else -> null
}
}
}.filterNot { it.importableFqName == null }
.filter(descriptorFilter)
.toSet()
}