[ULC] KtLightClassBase: do not override myInnersCache

^KT-56561
This commit is contained in:
Dmitrii Gridin
2023-02-10 12:40:15 +01:00
committed by Space Team
parent aae0cf9e30
commit f501259cd4
2 changed files with 13 additions and 12 deletions
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. * 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. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
@@ -18,10 +18,16 @@ import org.jetbrains.kotlin.idea.KotlinLanguage
abstract class KtLightClassBase protected constructor( abstract class KtLightClassBase protected constructor(
manager: PsiManager manager: PsiManager
) : AbstractLightClass(manager, KotlinLanguage.INSTANCE), KtExtensibleLightClass { ) : AbstractLightClass(manager, KotlinLanguage.INSTANCE), KtExtensibleLightClass {
protected open val myInnersCache = KotlinClassInnerStuffCache( private val myInnersCache by lazyPub {
myClass = this, KotlinClassInnerStuffCache(
dependencies = listOf(KotlinModificationTrackerService.getInstance(manager.project).outOfBlockModificationTracker), myClass = this,
lazyCreator = LightClassesLazyCreator(project) dependencies = cacheDependencies(),
lazyCreator = LightClassesLazyCreator(project)
)
}
protected open fun cacheDependencies(): List<Any> = listOf(
KotlinModificationTrackerService.getInstance(manager.project).outOfBlockModificationTracker
) )
override fun getDelegate() = override fun getDelegate() =
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. * 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. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
@@ -35,12 +35,7 @@ abstract class KtLightClassForSourceDeclaration(
protected val jvmDefaultMode: JvmDefaultMode, protected val jvmDefaultMode: JvmDefaultMode,
) : KtLightClassBase(classOrObject.manager), ) : KtLightClassBase(classOrObject.manager),
StubBasedPsiElement<KotlinClassOrObjectStub<out KtClassOrObject>> { StubBasedPsiElement<KotlinClassOrObjectStub<out KtClassOrObject>> {
override fun cacheDependencies(): List<Any> = classOrObject.getExternalDependencies()
override val myInnersCache: KotlinClassInnerStuffCache = KotlinClassInnerStuffCache(
myClass = this,
dependencies = classOrObject.getExternalDependencies(),
lazyCreator = LightClassesLazyCreator(project)
)
private val lightIdentifier = KtLightIdentifier(this, classOrObject) private val lightIdentifier = KtLightIdentifier(this, classOrObject)