Search in sources :

Example 1 with DefaultReferenceFinder

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

the class DefaultReferenceFinderTest 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 DefaultReferenceFinder(resourceDescriptions, get(IResourceServiceProvider.Registry.class), get(TargetURIConverter.class));
    localResourceAccess = new SimpleLocalResourceAccess(resourceSet);
    acceptor = new CheckingAcceptor();
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) ResourceSetBasedResourceDescriptions(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) SimpleLocalResourceAccess(org.eclipse.xtext.ui.editor.findrefs.SimpleLocalResourceAccess) DefaultReferenceFinder(org.eclipse.xtext.ui.editor.findrefs.DefaultReferenceFinder)

Aggregations

IResourceServiceProvider (org.eclipse.xtext.resource.IResourceServiceProvider)1 XtextResourceSet (org.eclipse.xtext.resource.XtextResourceSet)1 ResourceSetBasedResourceDescriptions (org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions)1 DefaultReferenceFinder (org.eclipse.xtext.ui.editor.findrefs.DefaultReferenceFinder)1 SimpleLocalResourceAccess (org.eclipse.xtext.ui.editor.findrefs.SimpleLocalResourceAccess)1