| Summary: | Validation depending on index fails | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Benjamin Schwertfeger <benjamin.schwertfeger> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sebastian.zarnekow |
| Version: | 1.0.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Benjamin Schwertfeger
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 Closing all bugs that were set to RESOLVED before Neon.0 |