void (@NotNull PsiJavaCodeReferenceElement ref, PsiElement parent, @NotNull QuickFixActionRegistrar registrar) { if ((parent instanceof PsiMethod || parent instanceof PsiField) && parent.getParent() instanceof PsiClass) { // record R() {} is parsed as method if records aren't supported // record R incomplete declaration is also possible registerIncreaseLevelFixes(ref, HighlightingFeature.RECORDS, registrar); } if (parent instanceof PsiLocalVariable && parent.getParent() instanceof PsiDeclarationStatement && ((PsiDeclarationStatement)parent.getParent()).getDeclaredElements().length == 1) { // record R() declaration inside method registerIncreaseLevelFixes(ref, HighlightingFeature.RECORDS, registrar); } }