boolean (@NotNull PsiElement element, @Nullable PsiClass outerClass) { if (outerClass == null) { return false; } if (outerClass.isRecord() && PsiTreeUtil.isAncestor(outerClass.getRecordHeader(), element, true)) { return true; } final PsiElement brace = outerClass.getLBrace(); return brace != null && brace.getTextOffset() < element.getTextOffset(); }