Groovy: minimal working implementation of findAttributeValue for GrUAnnotation

Required for IDEA-257331

GitOrigin-RevId: 422601d2ce5fea22de8c67a2878f8535abb1945b
This commit is contained in:
Yuriy Artamonov
2020-12-13 17:40:18 +00:00
committed by intellij-monorepo-bot
parent c5daf867c4
commit 8f71bdc342
@@ -118,14 +118,17 @@ class GrUAnnotation(val grElement: GrAnnotation,
}
}
override fun findAttributeValue(name: String?): UExpression? = null //not implemented
override fun findAttributeValue(name: String?): UExpression? = findDeclaredAttributeValue(name)
override fun findDeclaredAttributeValue(name: String?): UExpression? = null //not implemented
override fun findDeclaredAttributeValue(name: String?): UExpression? {
return grElement.parameterList.attributes.asSequence()
.find { it.name == name || it.name == null && "value" == name }
?.let { GrUNamedExpression(it) { this } }
}
override val uastParent: UElement? by lazy(parentProvider)
override val psi: PsiElement? = grElement
}
class GrUnknownUExpression(override val psi: PsiElement?, override val uastParent: UElement?) : UExpression {