KtLightAnnotationForSourceEntry fix for reading unnamed java-annotation parameter

This commit is contained in:
Nicolay Mitropolsky
2017-08-28 19:14:35 +03:00
committed by Pavel Talanov
parent e1924e0d2f
commit 108a40261b
2 changed files with 31 additions and 4 deletions
@@ -107,7 +107,7 @@ class KtLightAnnotationForSourceEntry(
val annotationConstructor = resolvedCall.resultingDescriptor
val parameterName =
memberValue.getNonStrictParentOfType<PsiNameValuePair>()?.name ?:
memberValue.getNonStrictParentOfType<PsiAnnotationMethod>()?.name ?:
memberValue.getNonStrictParentOfType<PsiAnnotationMethod>()?.takeIf { it.containingClass?.isAnnotationType == true }?.name ?:
"value"
val parameter = annotationConstructor.valueParameters.singleOrNull { it.name.asString() == parameterName } ?: return null