Community
Participate
Working Groups
If you write a validation and access the Xtext index inside, the validation fails after project clean, because the index is updated after the global validation. The order should be changed in PersistableResourceDescriptionsImpl. See also http://www.eclipse.org/forums/index.php?t=msg&th=198442. 1. Create a Check which references the Xtext index and warns, if the checked element is not inside. 2. create a model for the checked element in 1. 3. select project -> clean -> all projects 4. The error appears.
See Svens last message in the newsgroup: You should use the same IResourceDescriptions used in the AbstractGlobalScopeProvider so you will get a view on the IResourceDescriptions containing the old state, shadowed by the new state (and most important without the dirty resource information). This is the relevant code o obtain the right IResourceDescriptions based on the current context (we should encaspulate that better): @Inject @Named(NAMED_BUILDER_SCOPE) private Provider<IResourceDescriptions> builderScopeResourceDescriptions; @Inject private Provider<IResourceDescriptions> resourceDescriptions; public IResourceDescriptions getResourceDescriptions(EObject ctx) { Map<Object, Object> loadOptions = ctx.eResource().getResourceSet() .getLoadOptions(); IResourceDescriptions result = createResourceDescriptions(); if (loadOptions.containsKey(NAMED_BUILDER_SCOPE)) { result = createBuilderScopeResourceDescriptions(); } if (result instanceof IResourceDescriptions.IContextAware) { ((IResourceDescriptions.IContextAware) result).setContext(ctx); } return result; }
Closing all bugs that were set to RESOLVED before Neon.0