[uast] IDEA-332091 Less memory for UComment instances

GitOrigin-RevId: d11f11a61b5a86aebf6d71aecfb75d3e02f41153
This commit is contained in:
Yuriy Artamonov
2023-10-03 11:57:28 +02:00
committed by intellij-monorepo-bot
parent 5d7e54f360
commit 0624f30c19

View File

@@ -21,13 +21,16 @@ import org.jetbrains.uast.internal.log
open class UComment(override val sourcePsi: PsiComment, private val givenParent: UElement?) : UElement {
private val uastParentPart = UastLazyPart<UElement?>()
@Suppress("OverridingDeprecatedMember")
@get:ApiStatus.ScheduledForRemoval
@get:Deprecated("see the base property description")
@Deprecated("see the base property description", ReplaceWith("sourcePsi"))
override val psi: PsiComment get() = sourcePsi
override val uastParent: UElement? by lazy(LazyThreadSafetyMode.NONE) {
override val uastParent: UElement?
get() = uastParentPart.getOrBuild {
givenParent ?: sourcePsi.parent?.toUElement()
}