use of com.intellij.openapi.util.ModificationTracker in project android by JetBrains.
the class ProjectResourceCachedValueProvider method compute.
@Nullable
@Override
public final Result<T> compute() {
AndroidFacet[] facets = myComponent.getDataBindingEnabledFacets();
List<V> values = Lists.newArrayList();
List<ModificationTracker> newDependencies = Lists.newArrayList();
newDependencies.add(myComponent);
Collections.addAll(newDependencies, myAdditionalTrackers);
for (AndroidFacet facet : facets) {
CachedValue<V> cachedValue = getCachedValue(facet);
// we know this for sure since it is created from createCacheProvider
if (cachedValue.getValueProvider() instanceof ModificationTracker) {
newDependencies.add((ModificationTracker) cachedValue.getValueProvider());
}
V result = cachedValue.getValue();
if (result != null) {
values.add(result);
}
}
myDependencies = Collections.unmodifiableList(newDependencies);
myDependencyModificationCountOnCompute = calculateModificationCountFrom(myDependencies);
return Result.create(merge(values), this);
}
use of com.intellij.openapi.util.ModificationTracker in project intellij-community by JetBrains.
the class ClsFileImpl method getNavigationElement.
@Override
@NotNull
@SuppressWarnings("deprecation")
public PsiElement getNavigationElement() {
for (ClsCustomNavigationPolicy customNavigationPolicy : Extensions.getExtensions(ClsCustomNavigationPolicy.EP_NAME)) {
if (customNavigationPolicy instanceof ClsCustomNavigationPolicyEx) {
try {
PsiFile navigationElement = ((ClsCustomNavigationPolicyEx) customNavigationPolicy).getFileNavigationElement(this);
if (navigationElement != null) {
return navigationElement;
}
} catch (IndexNotReadyException ignore) {
}
}
}
return CachedValuesManager.getCachedValue(this, () -> {
PsiElement target = JavaPsiImplementationHelper.getInstance(getProject()).getClsFileNavigationElement(ClsFileImpl.this);
ModificationTracker tracker = FileIndexFacade.getInstance(getProject()).getRootModificationTracker();
return CachedValueProvider.Result.create(target, ClsFileImpl.this, target.getContainingFile(), tracker);
});
}
Aggregations