PsiAnnotationMethod (@NotNull PsiFile file, @NotNull Editor editor) { PsiNameValuePair pair = ParameterInfoUtils.findParentOfType(file, inferOffset(editor), PsiNameValuePair.class); if (pair == null) return null; final PsiReference reference = pair.getReference(); final PsiElement resolved = reference != null ? reference.resolve() : null; return PsiUtil.isAnnotationMethod(resolved) ? (PsiAnnotationMethod)resolved : null; }