boolean (@NotNull PsiElement elementToRename) { if (!(elementToRename instanceof PsiParameter)) return false; PsiMethod method = PsiTreeUtil.getParentOfType(elementToRename.getParent(), PsiMethod.class); if (method == null) return false; return JavaPsiRecordUtil.isExplicitCanonicalConstructor(method); }