boolean (@NotNull PsiElement place) { PsiElement scope = place; while(scope != null){ if (scope instanceof PsiDocComment) return true; if (scope instanceof PsiMember || scope instanceof PsiMethodCallExpression || scope instanceof PsiFile) return false; scope = scope.getContext(); } return false; }