Split scripts and class/object declarations in DeclarationsProvider

simplifies code in most places, avoids filtering in places where they
should be processed independently
This commit is contained in:
Ilya Chernikov
2019-02-12 15:26:37 +01:00
parent a218455193
commit e28017039d
10 changed files with 45 additions and 51 deletions
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.cli.jvm.repl
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtDestructuringDeclarationEntry
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.lazy.data.KtScriptInfo
import org.jetbrains.kotlin.resolve.lazy.declarations.PackageMemberDeclarationProvider
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
@@ -45,6 +46,8 @@ open class DelegatePackageMemberDeclarationProvider(var delegate: PackageMemberD
override fun getClassOrObjectDeclarations(name: Name) = delegate.getClassOrObjectDeclarations(name)
override fun getScriptDeclarations(name: Name): Collection<KtScriptInfo> = delegate.getScriptDeclarations(name)
override fun getTypeAliasDeclarations(name: Name) = delegate.getTypeAliasDeclarations(name)
override fun getDeclarationNames() = delegate.getDeclarationNames()