KtAnnotationEntry (@Nullable PsiElement element) { if (element == null) return null; KtAnnotationEntry annotationEntry = PsiTreeUtil.getParentOfType(element, KtAnnotationEntry.class); if (annotationEntry == null) return null; KtAnnotationUseSiteTarget useSiteTarget = annotationEntry.getUseSiteTarget(); if (useSiteTarget == null) return null; ASTNode node = useSiteTarget.getNode().getFirstChildNode(); if (node == null) return null; if (node.getElementType() != KtTokens.FILE_KEYWORD) return null; return annotationEntry; }