All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlin.analysis.providers.impl.KotlinStaticDeclarationIndex.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-RC
Show newest version
/*
 * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
 * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
 */

package org.jetbrains.kotlin.analysis.providers.impl

import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.*

internal class KotlinStaticDeclarationIndex {
    internal val facadeFileMap: MutableMap> = mutableMapOf()
    internal val multiFileClassPartMap: MutableMap> = mutableMapOf()
    internal val scriptMap: MutableMap> = mutableMapOf()
    internal val classMap: MutableMap> = mutableMapOf()
    internal val typeAliasMap: MutableMap> = mutableMapOf()
    internal val topLevelFunctionMap: MutableMap> = mutableMapOf()
    internal val topLevelPropertyMap: MutableMap> = mutableMapOf()

    /**
     * Allows quickly finding [KtClassOrObject]s which have a given simple name as a supertype. The map may contain local classes as well.
     */
    internal val classesBySupertypeName: MutableMap> = mutableMapOf()

    /**
     * Maps a simple name `N` to type aliases `A` in whose definition `N` occurs as the topmost user type, which is a prerequisite for other
     * classes inheriting from `N` by referring to `A`. Does not support function types (e.g. `Function1`).
     *
     * There is no guarantee that the type alias can be inherited from. For example, if its expanded type is final, the type alias is not
     * inheritable. The resulting type alias `A` may also occur in the expanded type of another type alias (which may also be inheritable),
     * so the index may need to be followed transitively.
     *
     * The index is used to find direct class inheritors.
     *
     * ### Example
     *
     * ```
     * abstract class C
     *
     * typealias A = C
     *
     * class X : A()
     * ```
     *
     * The index contains the following entry: `"C" -> A`.
     */
    internal val inheritableTypeAliasesByAliasedName: MutableMap> = mutableMapOf()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy