[Analysis API] change return type of KtScope.getAllSymbols to KtDeclaration symbol as it always returns callable or classifier

This commit is contained in:
Ilya Kirillov
2022-10-20 22:15:08 +02:00
committed by teamcity
parent 98e665a652
commit 3bc19fa2c7
4 changed files with 5 additions and 5 deletions
@@ -34,7 +34,7 @@ class KtCompositeScope(
}
}
override fun getAllSymbols(): Sequence<KtSymbol> = withValidityAssertion {
override fun getAllSymbols(): Sequence<KtDeclarationSymbol> = withValidityAssertion {
sequence {
subScopes.forEach { yieldAll(it.getAllSymbols()) }
}
@@ -25,7 +25,7 @@ class KtEmptyScope(override val token: KtLifetimeToken) : KtScope {
return emptySet()
}
override fun getAllSymbols(): Sequence<KtSymbol> = withValidityAssertion {
override fun getAllSymbols(): Sequence<KtDeclarationSymbol> = withValidityAssertion {
return emptySequence()
}
@@ -75,7 +75,7 @@ abstract class AbstractSymbolTest : AbstractAnalysisApiSingleFileTest() {
is KtDeclarationSymbol -> symbol.render(prettyRenderOptions)
is KtFileSymbol -> prettyPrint {
printCollection(symbol.getFileScope().getAllSymbols().asIterable(), separator = "\n\n") {
append((it as KtDeclarationSymbol).render(prettyRenderOptions))
append(it.render(prettyRenderOptions))
}
}
@@ -13,9 +13,9 @@ import org.jetbrains.kotlin.name.Name
public interface KtScope : KtScopeLike {
/**
* Return a sequence of all [KtSymbol] which current scope contain
* Return a sequence of all [KtDeclarationSymbol] which current scope contain
*/
public fun getAllSymbols(): Sequence<KtSymbol> = withValidityAssertion {
public fun getAllSymbols(): Sequence<KtDeclarationSymbol> = withValidityAssertion {
sequence {
yieldAll(getCallableSymbols())
yieldAll(getClassifierSymbols())