Community
Participate
Working Groups
Assume we have the following grammar: Model: entities+=Entity*; Entity: 'entity' name=ID ('extends' extends=[Entity])? '{' arributes+=Attribute* '}' ; Attribute: 'attr' name=ID ; And these model files file1.mydsl entity file1 { attr a1 attr a2 } file2.mydsl entity file2 extends file1 { } the editor for file2 is open and i do a file rename (F2) on file2.mydsl now if i (e.g in scoping) am asking the resourceserviceprovider for the resource description of the resource i am working on, then i get null as result. (we use the index to create some implicit imports) to reproduce that simply use public class MyDslImportedNamespaceAwareLocalScopeProvider extends ImportedNamespaceAwareLocalScopeProvider { @Inject private ResourceDescriptionsProvider resDescProvider; @Override protected IScope getResourceScope(Resource res, EReference reference) { new Exception().printStackTrace(); URI uri = res.getURI(); System.err.println(uri); IResourceDescriptions index = resDescProvider .getResourceDescriptions(res); System.err.println(index); IResourceDescription resourceDescription = index .getResourceDescription(uri); System.err.println(resourceDescription); System.err.println("============="); return super.getResourceScope(res, reference); } } @Override public void configureIScopeProviderDelegate(com.google.inject.Binder binder) { binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to( MyDslImportedNamespaceAwareLocalScopeProvider.class); }
Alternatively: is there a way to get this visible containers without having a starting resource description? or could i even create a fake start resource description?
(we use the index data to create implicit imports)
Wouldn't @Inject IResourceDescription.Manager manager and manager.getResourceDescription() work?
ill have a look an that. i just saw global scope provider uses the manager as well? when should the Manager and when the IResourceDescriptions itself be used?
(In reply to Christian Dietrich from comment #4) > ill have a look an that. i just saw global scope provider uses the manager > as well? when should the Manager and when the IResourceDescriptions itself > be used? I assume this question was answered in the meantime? Is this ticket still open?
i think we can live with that behavour. although a hint in the javadoc would be nice