public static boolean insideDeconstructionList(@NotNull PsiElement element) {
    if (!PsiUtil.isAvailable(JavaFeature.PATTERN_GUARDS_AND_RECORD_PATTERNS, element)) return false;
    return element.getParent() instanceof PsiJavaCodeReferenceElement ref &&
           ref.getParent() instanceof PsiTypeElement typeElement &&
           (typeElement.getParent() instanceof PsiDeconstructionList ||
            (typeElement.getParent() instanceof PsiPatternVariable patternVariable &&
             patternVariable.getParent() instanceof PsiTypeTestPattern typeTestPattern &&
             typeTestPattern.getParent() instanceof PsiDeconstructionList));
  }
public static boolean insideDeconstructionList(@NotNull PsiElement element)