use of org.eclipse.xtext.ide.util.CancelIndicatorProgressMonitor in project xtext-core by eclipse.
the class DocumentSymbolService method getReferences.
public List<? extends Location> getReferences(final XtextResource resource, final int offset, final IReferenceFinder.IResourceAccess resourceAccess, final IResourceDescriptions indexData, final CancelIndicator cancelIndicator) {
final EObject element = this._eObjectAtOffsetHelper.resolveElementAt(resource, offset);
if ((element == null)) {
return CollectionLiterals.<Location>emptyList();
}
final ArrayList<Location> locations = CollectionLiterals.<Location>newArrayList();
final TargetURIs targetURIs = this.collectTargetURIs(element);
final IAcceptor<IReferenceDescription> _function = (IReferenceDescription reference) -> {
final Procedure1<EObject> _function_1 = (EObject obj) -> {
final Location location = this._documentExtensions.newLocation(obj, reference.getEReference(), reference.getIndexInList());
if ((location != null)) {
locations.add(location);
}
};
this.doRead(resourceAccess, reference.getSourceEObjectUri(), _function_1);
};
ReferenceAcceptor _referenceAcceptor = new ReferenceAcceptor(this.resourceServiceProviderRegistry, _function);
CancelIndicatorProgressMonitor _cancelIndicatorProgressMonitor = new CancelIndicatorProgressMonitor(cancelIndicator);
this.referenceFinder.findAllReferences(targetURIs, resourceAccess, indexData, _referenceAcceptor, _cancelIndicatorProgressMonitor);
return locations;
}
Aggregations