Search in sources :

Example 1 with ReferenceAcceptor

use of org.eclipse.xtext.ui.editor.findrefs.ReferenceAcceptor in project n4js by eclipse.

the class LabellingReferenceFinder method toAcceptor.

@Override
protected Acceptor toAcceptor(IAcceptor<IReferenceDescription> acceptor) {
    return new ReferenceAcceptor(acceptor, getResourceServiceProviderRegistry()) {

        @Override
        public void accept(EObject source, URI sourceURI, EReference eReference, int index, EObject targetOrProxy, URI targetURI) {
            // Check if we should ignore named import specifier
            if (N4JSReferenceQueryExecutor.ignoreNamedImportSpecifier && source instanceof NamedImportSpecifier)
                return;
            EObject displayObject = calculateDisplayEObject(source);
            String logicallyQualifiedDisplayName = N4JSHierarchicalNameComputerHelper.calculateLogicallyQualifiedDisplayName(displayObject, labelProvider, false);
            ICompositeNode srcNode = NodeModelUtils.getNode(source);
            int line = srcNode.getStartLine();
            LabelledReferenceDescription description = new LabelledReferenceDescription(source, displayObject, sourceURI, targetOrProxy, targetURI, eReference, index, logicallyQualifiedDisplayName, line);
            accept(description);
        }
    };
}
Also used : ReferenceAcceptor(org.eclipse.xtext.ui.editor.findrefs.ReferenceAcceptor) NamedImportSpecifier(org.eclipse.n4js.n4JS.NamedImportSpecifier) EObject(org.eclipse.emf.ecore.EObject) ICompositeNode(org.eclipse.xtext.nodemodel.ICompositeNode) LabelledReferenceDescription(org.eclipse.n4js.ts.ui.search.LabelledReferenceDescription) URI(org.eclipse.emf.common.util.URI) EReference(org.eclipse.emf.ecore.EReference)

Aggregations

URI (org.eclipse.emf.common.util.URI)1 EObject (org.eclipse.emf.ecore.EObject)1 EReference (org.eclipse.emf.ecore.EReference)1 NamedImportSpecifier (org.eclipse.n4js.n4JS.NamedImportSpecifier)1 LabelledReferenceDescription (org.eclipse.n4js.ts.ui.search.LabelledReferenceDescription)1 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)1 ReferenceAcceptor (org.eclipse.xtext.ui.editor.findrefs.ReferenceAcceptor)1