private static Cache obtainCache(PsiElement psi, Key<CachedValue<Cache>> key) {
    var provider = TextContentModificationTrackerProvider.EP_NAME.forLanguage(psi.getLanguage());
    var tracker = provider == null ? PsiModificationTracker.MODIFICATION_COUNT : provider.getModificationTracker(psi);
    
    CachedValue<Cache> cache = CachedValuesManager.getManager(psi.getProject()).createCachedValue(
      () -> CachedValueProvider.Result.create(new Cache(), tracker));
    cache = ((UserDataHolderEx)psi).putUserDataIfAbsent(key, cache);
    return cache.getValue();
  }
private static Cache obtainCache(PsiElement psi, Key<CachedValue<Cache>> key)