boolean (@NotNull PsiErrorElement psiErrorElement) { PsiClass psiClass = PsiTreeUtil.getParentOfType(psiErrorElement, PsiClass.class); if (psiClass == null) return false; PsiElement lBrace = psiClass.getLBrace(); if (lBrace == null) return true; PsiElement rBrace = psiClass.getRBrace(); if (rBrace == null) return true; TextRange errorRange = psiErrorElement.getTextRange(); return lBrace.getTextOffset() <= errorRange.getStartOffset() && rBrace.getTextOffset() + 1 >= errorRange.getEndOffset(); }