FIR IDE: Add name filtering to scope KtScope and implementations

This commit is contained in:
Roman Golyshev
2020-09-16 13:19:50 +03:00
committed by Ilya Kirillov
parent dc600e3caf
commit 75d8710bf6
6 changed files with 29 additions and 30 deletions
@@ -27,14 +27,16 @@ interface KtScope : ValidityTokenOwner {
}
}
fun getCallableSymbols(): Sequence<KtCallableSymbol>
fun getClassifierSymbols(): Sequence<KtClassifierSymbol>
fun getCallableSymbols(nameFilter: KtScopeNameFilter = { true }): Sequence<KtCallableSymbol>
fun getClassifierSymbols(nameFilter: KtScopeNameFilter = { true }): Sequence<KtClassifierSymbol>
fun containsName(name: Name): Boolean = withValidityAssertion {
name in getCallableNames() || name in getClassifierNames()
}
}
typealias KtScopeNameFilter = (Name) -> Boolean
interface KtCompositeScope : KtScope {
val subScopes: List<KtScope>
}