Search in sources :

Example 6 with TargetURIs

use of org.eclipse.xtext.findReferences.TargetURIs in project xtext-core by eclipse.

the class DefaultCallHierarchyBuilder method findSourceDeclarations.

protected void findSourceDeclarations(final URI targetDeclarationURI, final IProgressMonitor monitor, final Procedure2<? super IEObjectDescription, ? super IReferenceDescription> acceptor) {
    final TargetURIs targetURIs = this.collectTargetURIs(targetDeclarationURI);
    IResourceServiceProvider.Registry _resourceServiceProviderRegistry = this.getResourceServiceProviderRegistry();
    final IAcceptor<IReferenceDescription> _function = (IReferenceDescription reference) -> {
        boolean _filterReference = this.filterReference(reference);
        if (_filterReference) {
            IEObjectDescription _findSourceDeclaration = null;
            if (reference != null) {
                _findSourceDeclaration = this.findSourceDeclaration(reference);
            }
            final IEObjectDescription sourceDeclaration = _findSourceDeclaration;
            acceptor.apply(sourceDeclaration, reference);
        }
    };
    ReferenceAcceptor _referenceAcceptor = new ReferenceAcceptor(_resourceServiceProviderRegistry, _function);
    this.getReferenceFinder().findAllReferences(targetURIs, this.getResourceAccess(), this.getIndexData(), _referenceAcceptor, monitor);
}
Also used : ReferenceAcceptor(org.eclipse.xtext.findReferences.ReferenceAcceptor) IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) TargetURIs(org.eclipse.xtext.findReferences.TargetURIs) IReferenceDescription(org.eclipse.xtext.resource.IReferenceDescription) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription)

Example 7 with TargetURIs

use of org.eclipse.xtext.findReferences.TargetURIs in project xtext-core by eclipse.

the class DocumentSymbolService method collectTargetURIs.

protected TargetURIs collectTargetURIs(final EObject targetObject) {
    final TargetURIs targetURIs = this.targetURIProvider.get();
    this.targetURICollector.add(targetObject, targetURIs);
    return targetURIs;
}
Also used : TargetURIs(org.eclipse.xtext.findReferences.TargetURIs)

Aggregations

TargetURIs (org.eclipse.xtext.findReferences.TargetURIs)7 EObject (org.eclipse.emf.ecore.EObject)4 URI (org.eclipse.emf.common.util.URI)2 Location (org.eclipse.lsp4j.Location)2 ReferenceAcceptor (org.eclipse.xtext.findReferences.ReferenceAcceptor)2 IReferenceDescription (org.eclipse.xtext.resource.IReferenceDescription)2 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 DocumentHighlight (org.eclipse.lsp4j.DocumentHighlight)1 Acceptor (org.eclipse.xtext.findReferences.IReferenceFinder.Acceptor)1 Document (org.eclipse.xtext.ide.server.Document)1 CancelIndicatorProgressMonitor (org.eclipse.xtext.ide.util.CancelIndicatorProgressMonitor)1 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)1 IParseResult (org.eclipse.xtext.parser.IParseResult)1 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)1 IResourceServiceProvider (org.eclipse.xtext.resource.IResourceServiceProvider)1 ITextRegion (org.eclipse.xtext.util.ITextRegion)1