private static boolean isCheapToSearchInFile(@NotNull PsiNamedElement element) {
    if (element.getName() == null) return false;
    return CachedValuesManager.getCachedValue(element, () -> {
      PsiFile file = element.getContainingFile();
      return CachedValueProvider.Result.create(calcCheapEnoughToSearchInFile(element, file), file);
    });
  }
private static boolean isCheapToSearchInFile(@NotNull PsiNamedElement element)