use of org.eclipse.xtext.findReferences.IReferenceFinder in project xtext-eclipse by eclipse.
the class DefaultReferenceFinder method findAllIndexedReferences.
/**
* @since 2.4
*/
protected void findAllIndexedReferences(IAcceptor<IReferenceDescription> referenceAcceptor, SubMonitor subMonitor, Set<URI> targetURIsAsSet, ILocalResourceAccess localResourceAccess) {
TargetURIs targetURIs = converter.fromIterable(targetURIsAsSet);
if (!targetURIs.isEmpty()) {
subMonitor.setWorkRemaining(size(indexData.getAllResourceDescriptions()) / MONITOR_CHUNK_SIZE + 1);
int i = 0;
IProgressMonitor useMe = subMonitor.newChild(1);
for (IResourceDescription resourceDescription : indexData.getAllResourceDescriptions()) {
IResourceServiceProvider serviceProvider = getServiceProviderRegistry().getResourceServiceProvider(resourceDescription.getURI());
if (serviceProvider != null) {
IReferenceFinder referenceFinder = serviceProvider.get(IReferenceFinder.class);
if (referenceFinder instanceof IReferenceFinderExtension1) {
IReferenceFinderExtension1 extension1 = (IReferenceFinderExtension1) referenceFinder;
extension1.findReferences(targetURIsAsSet, resourceDescription, referenceAcceptor, useMe, localResourceAccess);
} else {
// don't use the language specific reference finder here for backwards compatibility reasons
findReferences(targetURIsAsSet, resourceDescription, referenceAcceptor, useMe, localResourceAccess);
}
}
i++;
if (i % MONITOR_CHUNK_SIZE == 0) {
useMe = subMonitor.newChild(1);
}
}
}
}
Aggregations