use of org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions in project xtext-xtend by eclipse.
the class XtendBatchCompiler method getResourceDescriptions.
protected ResourceSetBasedResourceDescriptions getResourceDescriptions(ResourceSet resourceSet) {
ResourceSetBasedResourceDescriptions resourceDescriptions = resourceSetDescriptionsProvider.get();
resourceDescriptions.setContext(resourceSet);
resourceDescriptions.setRegistry(IResourceServiceProvider.Registry.INSTANCE);
return resourceDescriptions;
}
use of org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions in project xtext-core by eclipse.
the class LiveShadowedAllContainerStateTest method testContainsURI.
@Test
public void testContainsURI() {
String fileExtension = fep.getPrimaryFileExtension();
XtextResourceSet xtextResourceSet1 = rsp.get();
xtextResourceSet1.createResource(URI.createURI("/a/x." + fileExtension));
xtextResourceSet1.createResource(URI.createURI("/b/x1." + fileExtension));
ResourceSetBasedResourceDescriptions liveState = new ResourceSetBasedResourceDescriptions();
liveState.setContext(xtextResourceSet1);
liveState.setRegistry(registry);
Multimap<String, URI> container2Uris = ArrayListMultimap.create();
container2Uris.put("a", URI.createURI("/a/x." + fileExtension));
container2Uris.put("a", URI.createURI("/a/y." + fileExtension));
container2Uris.put("b", URI.createURI("/b/x1." + fileExtension));
container2Uris.put("b", URI.createURI("/b/x2." + fileExtension));
IAllContainersState containersState = containerStateProvider.get(liveState, new FakeAllContainerState(container2Uris));
assertTrue(containersState.containsURI("a", URI.createURI("/a/x." + fileExtension)));
assertTrue(containersState.containsURI("a", URI.createURI("/a/y." + fileExtension)));
assertFalse(containersState.containsURI("b", URI.createURI("/a/x." + fileExtension)));
assertFalse(containersState.containsURI("b", URI.createURI("/a/y." + fileExtension)));
assertTrue(containersState.containsURI("b", URI.createURI("/b/x1." + fileExtension)));
assertTrue(containersState.containsURI("b", URI.createURI("/b/x2." + fileExtension)));
assertFalse(containersState.containsURI("a", URI.createURI("/b/x1." + fileExtension)));
assertFalse(containersState.containsURI("a", URI.createURI("/b/x2." + fileExtension)));
}
use of org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions in project xtext-core by eclipse.
the class ResourceDescriptionsProvider method get.
public IResourceDescriptions get(ResourceSet resourceSet) {
ResourceSetBasedResourceDescriptions descriptions = new ResourceSetBasedResourceDescriptions();
descriptions.setContext(resourceSet);
descriptions.setRegistry(IResourceServiceProvider.Registry.INSTANCE);
return descriptions;
}
use of org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions in project xtext-core by eclipse.
the class LiveShadowedChunkedResourceDescriptions method setContext.
@Override
public void setContext(final Notifier ctx) {
IResourceDescriptions _localDescriptions = this.getLocalDescriptions();
final Procedure1<ResourceSetBasedResourceDescriptions> _function = (ResourceSetBasedResourceDescriptions it) -> {
it.setContext(ctx);
it.setData(null);
};
ObjectExtensions.<ResourceSetBasedResourceDescriptions>operator_doubleArrow(((ResourceSetBasedResourceDescriptions) _localDescriptions), _function);
final ResourceSet resourceSet = EcoreUtil2.getResourceSet(ctx);
this.setGlobalDescriptions(ChunkedResourceDescriptions.findInEmfObject(resourceSet));
IProjectConfig _projectConfig = null;
if (this.projectConfigProvider != null) {
_projectConfig = this.projectConfigProvider.getProjectConfig(resourceSet);
}
IWorkspaceConfig _workspaceConfig = null;
if (_projectConfig != null) {
_workspaceConfig = _projectConfig.getWorkspaceConfig();
}
this.workspaceConfig = _workspaceConfig;
}
use of org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions 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();
}
Aggregations