Community
Participate
Working Groups
Steps to reproduce: 1. Create language 2. fire up your runtime workspace 3. let the xtext builder index some models 4. Trigger an action, which creates a model programmatically. The model contains cross references to the files in the workspace. serialize the model. This will lead to serialization exceptions because the cross references can not be serialized because scoping provides no global scopes because there are no visible containers because the container handle for the to-be-serialized model can not be determined because the packagesFragmentURI is not determined because the to-be-serialized-file doesn't exist yet. Files shouldn't need to exist on the disk to be serializeable ;) A second problem is that the cache in org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider.getVisibleContainers(EObject) is not invalidated. Stack trace of the evil "if (!file.exists()) return null;" JavaProjectsStateHelper.getPackageFragmentRoot(URI) line: 149 JavaProjectsStateHelper.initHandle(URI) line: 48 JavaProjectsState.doInitHandle(URI) line: 40 JavaProjectsState(AbstractAllContainersState).initHandle(URI) line: 102 JavaProjectsState(AbstractAllContainersState).getContainerHandle(URI) line: 96 StateBasedContainerManager.internalGetContainerHandle(IResourceDescription, IResourceDescriptions) line: 75 StateBasedContainerManager.getVisibleContainers(IResourceDescription, IResourceDescriptions) line: 44 DefaultGlobalScopeProvider.getVisibleContainers(EObject) line: 61 DefaultGlobalScopeProvider.getScope(EObject, EReference) line: 43 ImportedNamespaceAwareLocalScopeProvider(AbstractGlobalScopeDelegatingScopeProvider).getGlobalScope(EObject, EReference) line: 30 ImportedNamespaceAwareLocalScopeProvider.getScope(EObject, EReference) line: 125 ImportedNamespaceAwareLocalScopeProvider.getScope(EObject, EReference) line: 129
Fixed in HEAD.
Closing bug which were set to RESOLVED before Eclipse Neon.0.