Search in sources :

Example 1 with DelegatingReferenceFinder

use of org.eclipse.xtext.ui.editor.findrefs.DelegatingReferenceFinder in project xtext-eclipse by eclipse.

the class DelegatingReferenceFinderTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    with(RefactoringTestLanguageStandaloneSetup.class);
    resourceSet = get(XtextResourceSet.class);
    resource = loadResource("test.refactoringtestlanguage", "A { B { ref A } } C");
    elementA = resource.getContents().get(0).eContents().get(0);
    elementB = elementA.eContents().get(0);
    elementC = resource.getContents().get(0).eContents().get(1);
    resourceSet.getResources().add(resource);
    ResourceSetBasedResourceDescriptions resourceDescriptions = get(ResourceSetBasedResourceDescriptions.class);
    resourceDescriptions.setContext(resourceSet);
    referenceFinder = new DelegatingReferenceFinder();
    referenceFinder.setIndexData(resourceDescriptions);
    referenceFinder.setConverter(get(TargetURIConverter.class));
    referenceFinder.setDelegate(get(org.eclipse.xtext.findReferences.IReferenceFinder.class));
    referenceFinder.setResourceServiceProviderRegistry(get(IResourceServiceProvider.Registry.class));
    localResourceAccess = new SimpleLocalResourceAccess(resourceSet);
    acceptor = new CheckingAcceptor();
}
Also used : ResourceSetBasedResourceDescriptions(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions) IReferenceFinder(org.eclipse.xtext.ui.editor.findrefs.IReferenceFinder) DelegatingReferenceFinder(org.eclipse.xtext.ui.editor.findrefs.DelegatingReferenceFinder) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) SimpleLocalResourceAccess(org.eclipse.xtext.ui.editor.findrefs.SimpleLocalResourceAccess) TargetURIConverter(org.eclipse.xtext.findReferences.TargetURIConverter)

Aggregations

TargetURIConverter (org.eclipse.xtext.findReferences.TargetURIConverter)1 XtextResourceSet (org.eclipse.xtext.resource.XtextResourceSet)1 ResourceSetBasedResourceDescriptions (org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions)1 DelegatingReferenceFinder (org.eclipse.xtext.ui.editor.findrefs.DelegatingReferenceFinder)1 IReferenceFinder (org.eclipse.xtext.ui.editor.findrefs.IReferenceFinder)1 SimpleLocalResourceAccess (org.eclipse.xtext.ui.editor.findrefs.SimpleLocalResourceAccess)1