[Analysis API] change return type of KtScope.getAllSymbols to KtDeclaration symbol as it always returns callable or classifier
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ class KtCompositeScope(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getAllSymbols(): Sequence<KtSymbol> = withValidityAssertion {
|
override fun getAllSymbols(): Sequence<KtDeclarationSymbol> = withValidityAssertion {
|
||||||
sequence {
|
sequence {
|
||||||
subScopes.forEach { yieldAll(it.getAllSymbols()) }
|
subScopes.forEach { yieldAll(it.getAllSymbols()) }
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ class KtEmptyScope(override val token: KtLifetimeToken) : KtScope {
|
|||||||
return emptySet()
|
return emptySet()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getAllSymbols(): Sequence<KtSymbol> = withValidityAssertion {
|
override fun getAllSymbols(): Sequence<KtDeclarationSymbol> = withValidityAssertion {
|
||||||
return emptySequence()
|
return emptySequence()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ abstract class AbstractSymbolTest : AbstractAnalysisApiSingleFileTest() {
|
|||||||
is KtDeclarationSymbol -> symbol.render(prettyRenderOptions)
|
is KtDeclarationSymbol -> symbol.render(prettyRenderOptions)
|
||||||
is KtFileSymbol -> prettyPrint {
|
is KtFileSymbol -> prettyPrint {
|
||||||
printCollection(symbol.getFileScope().getAllSymbols().asIterable(), separator = "\n\n") {
|
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 {
|
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 {
|
sequence {
|
||||||
yieldAll(getCallableSymbols())
|
yieldAll(getCallableSymbols())
|
||||||
yieldAll(getClassifierSymbols())
|
yieldAll(getClassifierSymbols())
|
||||||
|
|||||||
Reference in New Issue
Block a user