Skip to content

KotlinPackageProviderBase

abstract class KotlinPackageProviderBase(project: Project, val searchScope: GlobalSearchScope) : KotlinPackageProvider

Constructors

KotlinPackageProviderBase

constructor(project: Project, searchScope: GlobalSearchScope)

Properties

searchScope

val searchScope: GlobalSearchScope

Functions

doesKotlinOnlyPackageExist

abstract fun doesKotlinOnlyPackageExist(packageFqName: FqName): Boolean

Checks if a package named packageFqName exists. The package should contain Kotlin declarations.

Note that for Kotlin, a package doesn't need to correspond to a directory structure like in Java. So, a file's package FqName is determined by the package directive.

doesPackageExist

open override fun doesPackageExist(packageFqName: FqName, platform: TargetPlatform): Boolean

Checks if a package named packageFqName exists in the context of the given platform. This includes Kotlin packages as well as platform-specific packages.

Generally, the result is equal to: doesKotlinOnlyPackageExist || doesPlatformSpecificPackageExist.

doesPlatformSpecificPackageExist

open override fun doesPlatformSpecificPackageExist(packageFqName: FqName, platform: TargetPlatform): Boolean

Checks if a package named packageFqName exists. The package should contain platform-specific declarations.

getKotlinOnlySubpackageNames

abstract fun getKotlinOnlySubpackageNames(packageFqName: FqName): Set<Name>

Returns the list of subpackages of a given package which contain Kotlin declarations.

getPlatformSpecificSubpackageNames

open override fun getPlatformSpecificSubpackageNames(packageFqName: FqName, platform: TargetPlatform): Set<Name>

Returns the list of subpackages of a given package which contain platform-specific declarations.

getSubpackageNames

open override fun getSubpackageNames(packageFqName: FqName, platform: TargetPlatform): Set<Name>

Returns the list of subpackages of a given package.

The returned subpackage list contains both Kotlin and platform-specific subpackages (e.g., for Kotlin/JVM, it should include Java packages).

Generally, the result is equal to: getKotlinOnlySubpackageNames union getPlatformSpecificSubpackageNames.