private static boolean isCanonicalConstructorParameter(@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);
  }
private static boolean isCanonicalConstructorParameter(@NotNull PsiElement elementToRename)