private static boolean hasErrors(@NotNull PsiFile psiFile) {
    CachedValuesManager cachedValuesManager = CachedValuesManager.getManager(psiFile.getProject());
    return cachedValuesManager.getCachedValue(
      psiFile, CONTAINS_ERROR_ELEMENT,
      () -> CachedValueProvider.Result.create(hasErrorElements(psiFile), psiFile),
      false
    );
  }
private static boolean hasErrors(@NotNull PsiFile psiFile)