Home » Modeling » TMF (Xtext) » How to access Xcore model from Xtext?
| |
Re: How to access Xcore model from Xtext? [message #910987 is a reply to message #910948] |
Mon, 10 September 2012 19:03 |
|
Hi,
i just gave this a try and it does not work.
the reason is that org.eclipse.xtext.xtext.XtextLinkingService.getResolvedEPackage(IEObjectDescription, EObject)
gives null for the eobjectdescription of the epackage.
looks like the xcoreresourcedescriptionstrategy creates invalid iEObjectDescriptions
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: How to access Xcore model from Xtext? [message #910996 is a reply to message #910987] |
Mon, 10 September 2012 19:21 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Christian,
If the resource descriptions produced for Xcore were invalid, Xcore
wouldn't be able to make any cross resource references, so there must be
more to the story than that...
When you said you wanted to import the package in your Xtext DSL, did
you mean in the grammar for your DSL, or in the instances of the DSL
you're designing? I know Moritz was looking at how to support the
former and we had some discussions about whether the models should be on
the classpath or not; when they're in the model folder, they're not on
the classpath...
On 10/09/2012 9:03 PM, Christian Dietrich wrote:
> Hi,
>
> i just gave this a try and it does not work.
> the reason is that
> org.eclipse.xtext.xtext.XtextLinkingService.getResolvedEPackage(IEObjectDescription,
> EObject)
> gives null for the eobjectdescription of the epackage.
> looks like the xcoreresourcedescriptionstrategy creates invalid
> iEObjectDescriptions
>
> ~Christian
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | | |
Re: How to access Xcore model from Xtext? [message #911163 is a reply to message #911148] |
Tue, 11 September 2012 05:35 |
|
Hi Ed,
yes the missing / in the second case is in deed a typo.
never the less the the first case i still get the strange notation.
i use xtext 2.3.1 and Xcore 1.0.0
(Eclipse doesnt show me any updates)
since i use a fresh project everything was index with that version.
if i take a loot at the LazyCreationProxyURIConverter source code i see no exception for EPackage
public String encodeFragment(EClass eClass, QualifiedName name)
{
return (eClass.getEPackage() == TypesPackage.eINSTANCE ? "JvmType" : eClass.getName()) + DELIM + name.toString();
}
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: How to access Xcore model from Xtext? [message #911172 is a reply to message #911163] |
Tue, 11 September 2012 06:00 |
Jan Rosczak Messages: 53 Registered: July 2009 Location: Hamburg, Germany |
Member |
|
|
Hi Ed, Christian,
thank you for your replies. Today I discovered a way to do what I want:
1. Convert the Xcore model to a Genmodel and Ecore model
2. Use the package namespace URI in the import statement
3. Do not be confused by the fact that the content assist in the Xtext grammer editor does not list that package URI.
Still, it would be nice if the Xtext index could use the Xcore model directly.
~Jan
[Updated on: Tue, 11 September 2012 06:07] Report message to a moderator
|
|
|
Re: How to access Xcore model from Xtext? [message #911280 is a reply to message #911163] |
Tue, 11 September 2012 09:35 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Christian,
Yes, but it's called from two places
org.eclipse.emf.ecore.xcore.resource.XcoreResource.getURIFragment(EObject)
public String getURIFragment(EObject object)
{
EClass eClass = object.eClass();
if (eClass == TypesPackage.Literals.JVM_ENUMERATION_TYPE || eClass
== GenModelPackage.Literals.GEN_CLASS
|| eClass == GenModelPackage.Literals.GEN_DATA_TYPE || eClass ==
GenModelPackage.Literals.GEN_ENUM
|| eClass == TypesPackage.Literals.JVM_GENERIC_TYPE)
{
QualifiedName qualifiedName =
nameProvider.getFullyQualifiedName(object);
if (qualifiedName != null)
{
return proxyConverter.encodeFragment(eClass, qualifiedName);
}
}
return super.getURIFragment(object);
and
org.eclipse.emf.ecore.xcore.scoping.LazyCreationProxyURIConverter.getProxyURI(URI,
EObject, QualifiedName)
public URI getProxyURI(URI resourceURI, EObject eObject,
QualifiedName name)
{
if (!isSupported(eObject))
{
throw new IllegalArgumentException("eObjects of type " +
eObject.eClass().getName() + " are not supported.");
}
return resourceURI.appendFragment(encodeFragment(eObject.eClass(),
name));
}
So it shouldn't get there. Can you set a breakpoint to see why it gets
there? I never hit that for an EPackage...
On 11/09/2012 7:35 AM, Christian Dietrich wrote:
> Hi Ed,
>
> yes the missing / in the second case is in deed a typo.
> never the less the the first case i still get the strange notation.
> i use xtext 2.3.1 and Xcore 1.0.0
> (Eclipse doesnt show me any updates)
>
> since i use a fresh project everything was index with that version.
>
> if i take a loot at the LazyCreationProxyURIConverter source code i
> see no exception for EPackage
>
>
> public String encodeFragment(EClass eClass, QualifiedName name)
> {
> return (eClass.getEPackage() == TypesPackage.eINSTANCE ? "JvmType"
> : eClass.getName()) + DELIM + name.toString();
> }
>
>
> ~Christian
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | |
Re: How to access Xcore model from Xtext? [message #911317 is a reply to message #911313] |
Tue, 11 September 2012 10:47 |
|
Hi,
i edit the xcore file with breakpoint in XcoreResource then i get the following stacktrace
Thread [Worker-4] (Suspended (breakpoint at line 218 in XcoreResource))
XcoreResource.getURIFragment(EObject) line: 218
EcoreUtil.getURI(EObject) line: 2984
XcoreReferableElementsUnloader.unloadRoot(EObject) line: 34
XcoreModelAssociator.discardDerivedState(DerivedStateAwareResource) line: 162
XcoreResource(DerivedStateAwareResource).discardDerivedState() line: 111
XcoreResource(DerivedStateAwareResource).updateInternalState(IParseResult, IParseResult) line: 59
XcoreResource(XtextResource).update(int, int, String) line: 218
XtextReconcilerUnitOfWork.process(XtextResource) line: 55
XtextReconcilerUnitOfWork.process(Object) line: 1
XtextReconcilerUnitOfWork(IUnitOfWork$Void<T>).exec(T) line: 36
XtextDocument$XtextDocumentLocker(AbstractReadWriteAcces<P>).modify(IUnitOfWork<T,P>) line: 49
XtextDocument$XtextDocumentLocker.modify(IUnitOfWork<T,XtextResource>) line: 181
XtextDocument.internalModify(IUnitOfWork<T,XtextResource>) line: 90
XtextDocumentReconcileStrategy.reconcile(IRegion) line: 44
XtextReconciler.run(IProgressMonitor) line: 254
Worker.run() line: 54
Thread [Worker-3] (Suspended (breakpoint at line 218 in XcoreResource))
owns: XcoreResource (id=12691)
owns: GrammarResource (id=12692)
owns: ClusteringBuilderState (id=11449)
XcoreResource.getURIFragment(EObject) line: 218
XcoreResource$FragmentCache.buildEntry(EObject) line: 88
XcoreResource$FragmentCache.get(String) line: 78
XcoreResource.getEObject(String) line: 156
XtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223
EcoreUtil.resolve(EObject, ResourceSet) line: 197
EcoreUtil.resolve(EObject, EObject) line: 257
XGenericTypeImpl(BasicEObjectImpl).eResolveProxy(InternalEObject) line: 1473
XGenericTypeImpl.getType() line: 232
XcoreEcoreBuilder$3.run() line: 552
XcoreEcoreBuilder.link() line: 120
XcoreModelAssociator.installDerivedState(DerivedStateAwareResource, boolean) line: 81
XcoreResource(DerivedStateAwareResource).installDerivedState(boolean) line: 125
XcoreResource(DerivedStateAwareResource).getContents() line: 48
XcoreResource$FragmentCache.get(String) line: 67
XcoreResource.getEObject(String) line: 156
XtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223
EcoreUtil.resolve(EObject, ResourceSet) line: 197
EcoreUtil.resolve(EObject, EObject) line: 257
XtextLinkingService.getResolvedEPackage(IEObjectDescription, EObject) line: 183
XtextLinkingService.findPackageInScope(EObject, QualifiedName) line: 177
XtextLinkingService.getPackage(ReferencedMetamodel, ILeafNode) line: 157
XtextLinkingService.getLinkedObjects(EObject, EReference, INode) line: 95
XtextLinker(Linker).getLinkedObject(EObject, EReference, INode) line: 211
XtextLinker(Linker).ensureIsLinked(EObject, INode, CrossReference, Set<EReference>, IDiagnosticProducer) line: 120
XtextLinker(Linker).ensureLinked(EObject, IDiagnosticProducer, ICompositeNode, Set<EReference>) line: 69
XtextLinker(Linker).ensureLinked(EObject, IDiagnosticProducer) line: 56
XtextLinker(Linker).ensureModelLinked(EObject, IDiagnosticProducer) line: 236
XtextLinker(Linker).doLinkModel(EObject, IDiagnosticConsumer) line: 229
XtextLinker(AbstractCleaningLinker).linkModel(EObject, IDiagnosticConsumer) line: 38
XtextLinker.linkModel(EObject, IDiagnosticConsumer) line: 220
GrammarResource(XtextResource).doLinking() line: 279
GrammarResource(LazyLinkingResource).doLinking() line: 82
GrammarResource.superDoLinking() line: 42
GrammarResource$LinkingTrigger.installDerivedState(DerivedStateAwareResource, boolean) line: 75
GrammarResource(DerivedStateAwareResource).installDerivedState(boolean) line: 125
GrammarResource(DerivedStateAwareResource).getContents() line: 48
EcoreUtil.getAllContents(Resource, boolean) line: 1121
GrammarResource(LazyLinkingResource).resolveLazyCrossReferences(CancelIndicator) line: 97
EcoreUtil2.resolveLazyCrossReferences(Resource, CancelIndicator) line: 497
ClusteringBuilderState.doUpdate(BuildData, ResourceDescriptionsData, IProgressMonitor) line: 204
ClusteringBuilderState(AbstractBuilderState).update(BuildData, IProgressMonitor) line: 105
XtextBuilder.doBuild(ToBeBuilt, IProgressMonitor, IXtextBuilderParticipant$BuildType) line: 159
XtextBuilder.fullBuild(IProgressMonitor, boolean) line: 188
XtextBuilder.build(int, Map, IProgressMonitor) line: 85
BuildManager$2.run() line: 728
SafeRunner.run(ISafeRunnable) line: 42
BuildManager.basicBuild(int, IncrementalProjectBuilder, Map<String,String>, MultiStatus, IProgressMonitor) line: 199
BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext, ICommand[], MultiStatus, IProgressMonitor) line: 239
BuildManager$1.run() line: 292
SafeRunner.run(ISafeRunnable) line: 42
BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext, MultiStatus, IProgressMonitor) line: 295
BuildManager.basicBuildLoop(IBuildConfiguration[], IBuildConfiguration[], int, MultiStatus, IProgressMonitor) line: 351
BuildManager.build(IBuildConfiguration[], IBuildConfiguration[], int, IProgressMonitor) line: 374
AutoBuildJob.doBuild(IProgressMonitor) line: 143
AutoBuildJob.run(IProgressMonitor) line: 241
Worker.run() line: 54
the actual problem happens in EObjectDescription.getEObjectURI() - when editing the xtext file
it returns the fragment EPackage-=-sample
but this leads to a filtering in org.eclipse.xtext.xtext.XtextLinkingService.findPackageInScope(EObject, QualifiedName)
since it cannot be resolved against this fragment
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: How to access Xcore model from Xtext? [message #911327 is a reply to message #911317] |
Tue, 11 September 2012 11:07 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Christian,
Comments below.
On 11/09/2012 12:47 PM, Christian Dietrich wrote:
> Hi,
>
> i edit the xcore file with breakpoint in XcoreResource then i get the
> following stacktrace
>
> Thread [Worker-4] (Suspended (breakpoint at line 218 in XcoreResource))
> XcoreResource.getURIFragment(EObject) line: 218
Given it looks like this:
public String getURIFragment(EObject object)
{
EClass eClass = object.eClass();
if (eClass == TypesPackage.Literals.JVM_ENUMERATION_TYPE || eClass
== GenModelPackage.Literals.GEN_CLASS
|| eClass == GenModelPackage.Literals.GEN_DATA_TYPE || eClass ==
GenModelPackage.Literals.GEN_ENUM
|| eClass == TypesPackage.Literals.JVM_GENERIC_TYPE)
{
QualifiedName qualifiedName =
nameProvider.getFullyQualifiedName(object);
if (qualifiedName != null)
{
return proxyConverter.encodeFragment(eClass, qualifiedName);
}
}
return super.getURIFragment(object);
}
It must be calling super. This doesn't tell me how it gets to this
method though:
org.eclipse.emf.ecore.xcore.scoping.LazyCreationProxyURIConverter.encodeFragment(EClass,
QualifiedName)
> EcoreUtil.getURI(EObject) line: 2984
> XcoreReferableElementsUnloader.unloadRoot(EObject) line: 34
> XcoreModelAssociator.discardDerivedState(DerivedStateAwareResource) line:
> 162
> XcoreResource(DerivedStateAwareResource).discardDerivedState()
> line: 111
> XcoreResource(DerivedStateAwareResource).updateInternalState(IParseResult,
> IParseResult) line: 59
> XcoreResource(XtextResource).update(int, int, String) line: 218
> XtextReconcilerUnitOfWork.process(XtextResource) line: 55
> XtextReconcilerUnitOfWork.process(Object) line: 1
> XtextReconcilerUnitOfWork(IUnitOfWork$Void<T>).exec(T) line: 36
> XtextDocument$XtextDocumentLocker(AbstractReadWriteAcces<P>).modify(IUnitOfWork<T,P>)
> line: 49
> XtextDocument$XtextDocumentLocker.modify(IUnitOfWork<T,XtextResource>)
> line: 181
> XtextDocument.internalModify(IUnitOfWork<T,XtextResource>) line: 90
> XtextDocumentReconcileStrategy.reconcile(IRegion) line: 44
> XtextReconciler.run(IProgressMonitor) line: 254
> Worker.run() line: 54
>
> Thread [Worker-3] (Suspended (breakpoint at line 218 in XcoreResource))
> owns: XcoreResource (id=12691)
> owns: GrammarResource (id=12692)
> owns: ClusteringBuilderState (id=11449)
> XcoreResource.getURIFragment(EObject) line: 218
> XcoreResource$FragmentCache.buildEntry(EObject) line: 88
> XcoreResource$FragmentCache.get(String) line: 78
> XcoreResource.getEObject(String) line: 156
> XtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223
> EcoreUtil.resolve(EObject, ResourceSet) line: 197
> EcoreUtil.resolve(EObject, EObject) line: 257
> XGenericTypeImpl(BasicEObjectImpl).eResolveProxy(InternalEObject)
> line: 1473
> XGenericTypeImpl.getType() line: 232
> XcoreEcoreBuilder$3.run() line: 552
> XcoreEcoreBuilder.link() line: 120
> XcoreModelAssociator.installDerivedState(DerivedStateAwareResource, boolean)
> line: 81
> XcoreResource(DerivedStateAwareResource).installDerivedState(boolean)
> line: 125
> XcoreResource(DerivedStateAwareResource).getContents() line: 48
> XcoreResource$FragmentCache.get(String) line: 67
> XcoreResource.getEObject(String) line: 156
> XtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223
> EcoreUtil.resolve(EObject, ResourceSet) line: 197
> EcoreUtil.resolve(EObject, EObject) line: 257
> XtextLinkingService.getResolvedEPackage(IEObjectDescription,
> EObject) line: 183
> XtextLinkingService.findPackageInScope(EObject, QualifiedName)
> line: 177
> XtextLinkingService.getPackage(ReferencedMetamodel, ILeafNode)
> line: 157
> XtextLinkingService.getLinkedObjects(EObject, EReference, INode)
> line: 95
> XtextLinker(Linker).getLinkedObject(EObject, EReference, INode)
> line: 211
> XtextLinker(Linker).ensureIsLinked(EObject, INode, CrossReference,
> Set<EReference>, IDiagnosticProducer) line: 120
> XtextLinker(Linker).ensureLinked(EObject, IDiagnosticProducer,
> ICompositeNode, Set<EReference>) line: 69
> XtextLinker(Linker).ensureLinked(EObject, IDiagnosticProducer)
> line: 56
> XtextLinker(Linker).ensureModelLinked(EObject,
> IDiagnosticProducer) line: 236
> XtextLinker(Linker).doLinkModel(EObject, IDiagnosticConsumer)
> line: 229
> XtextLinker(AbstractCleaningLinker).linkModel(EObject,
> IDiagnosticConsumer) line: 38
> XtextLinker.linkModel(EObject, IDiagnosticConsumer) line: 220
> GrammarResource(XtextResource).doLinking() line: 279
> GrammarResource(LazyLinkingResource).doLinking() line: 82
> GrammarResource.superDoLinking() line: 42
> GrammarResource$LinkingTrigger.installDerivedState(DerivedStateAwareResource,
> boolean) line: 75
> GrammarResource(DerivedStateAwareResource).installDerivedState(boolean)
> line: 125
> GrammarResource(DerivedStateAwareResource).getContents() line: 48
> EcoreUtil.getAllContents(Resource, boolean) line: 1121
> GrammarResource(LazyLinkingResource).resolveLazyCrossReferences(CancelIndicator)
> line: 97
> EcoreUtil2.resolveLazyCrossReferences(Resource, CancelIndicator)
> line: 497
> ClusteringBuilderState.doUpdate(BuildData,
> ResourceDescriptionsData, IProgressMonitor) line: 204
> ClusteringBuilderState(AbstractBuilderState).update(BuildData,
> IProgressMonitor) line: 105
> XtextBuilder.doBuild(ToBeBuilt, IProgressMonitor,
> IXtextBuilderParticipant$BuildType) line: 159
> XtextBuilder.fullBuild(IProgressMonitor, boolean) line: 188
> XtextBuilder.build(int, Map, IProgressMonitor) line: 85
> BuildManager$2.run() line: 728
> SafeRunner.run(ISafeRunnable) line: 42
> BuildManager.basicBuild(int, IncrementalProjectBuilder,
> Map<String,String>, MultiStatus, IProgressMonitor) line: 199
> BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext,
> ICommand[], MultiStatus, IProgressMonitor) line: 239
> BuildManager$1.run() line: 292
> SafeRunner.run(ISafeRunnable) line: 42
> BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext,
> MultiStatus, IProgressMonitor) line: 295
> BuildManager.basicBuildLoop(IBuildConfiguration[],
> IBuildConfiguration[], int, MultiStatus, IProgressMonitor) line: 351
> BuildManager.build(IBuildConfiguration[], IBuildConfiguration[],
> int, IProgressMonitor) line: 374
> AutoBuildJob.doBuild(IProgressMonitor) line: 143
> AutoBuildJob.run(IProgressMonitor) line: 241
> Worker.run() line: 54
>
> the actual problem happens in EObjectDescription.getEObjectURI() -
> when editing the xtext file
> it returns the fragment EPackage-=-sample
Why? It must have gotten to
org.eclipse.emf.ecore.xcore.scoping.LazyCreationProxyURIConverter.encodeFragment(EClass,
QualifiedName) but how? A call stack leading to that method for the
EPackage EClass is what I'm missing...
>
> but this leads to a filtering in
> org.eclipse.xtext.xtext.XtextLinkingService.findPackageInScope(EObject, QualifiedName)
>
> since it cannot be resolved against this fragment
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: How to access Xcore model from Xtext? [message #911328 is a reply to message #911327] |
Tue, 11 September 2012 11:40 |
|
Hi Ed,
(EClass is EPackage and same is sample)
see
Thread [Worker-3] (Suspended (breakpoint at line 106 in
LazyCreationProxyURIConverter))
owns: XcoreResource (id=13155)
owns: GrammarResource (id=13156)
owns: ClusteringBuilderState (id=11449)
LazyCreationProxyURIConverter.encodeFragment(EClass, QualifiedName) line: 106
LazyCreationProxyURIConverter.getProxyURI(URI, EObject, QualifiedName)
line: 67
LazyCreationProxyURIConverter.installProxyURI(URI, EObject,
QualifiedName) line: 57
XcoreResourceDescriptionStrategy.createEObjectDescriptions(EObject,
IAcceptor<IEObjectDescription>) line: 135
XcoreResourceDescription(DefaultResourceDescription).computeExportedObjects()
line: 88
XcoreResourceDescription.getLookUp() line: 35
XcoreResourceDescription(AbstractResourceDescription).isEmpty() line: 28
SelectableBasedScope.createScope(IScope, ISelectable,
Predicate<IEObjectDescription>, EClass, boolean) line: 29
SelectableBasedScope.createScope(IScope, ISelectable, EClass, boolean)
line: 25
XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getResourceScope(IScope,
EObject, EReference) line: 113
XcoreImportedNamespaceAwareScopeProvider.getResourceScope(IScope,
EObject, EReference) line: 82
XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getResourceScope(Resource,
EReference) line: 101
XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getScope(EObject,
EReference) line: 89
XcoreImportedNamespaceAwareScopeProvider.getScope(EObject, EReference)
line: 178
XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getScope(EObject,
EReference) line: 87
XcoreImportedNamespaceAwareScopeProvider.getScope(EObject, EReference)
line: 178
XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getScope(EObject,
EReference) line: 87
XcoreImportedNamespaceAwareScopeProvider.getScope(EObject, EReference)
line: 178
XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getScope(EObject,
EReference) line: 87
XcoreImportedNamespaceAwareScopeProvider.getScope(EObject, EReference)
line: 178
XcoreScopeProvider(XtypeScopeProvider).getScope(EObject, EReference) line: 33
XcoreScopeProvider(XbaseScopeProvider).getScope(EObject, EReference)
line: 187
XcoreScopeProvider.getScope(EObject, EReference) line: 217
XbaseLinkingScopeProvider.getScope(EObject, EReference) line: 42
DefaultLinkingService.getScope(EObject, EReference) line: 59
DefaultLinkingService.getLinkedObjects(EObject, EReference, INode) line: 119
XcoreResource(LazyLinkingResource).getEObject(String) line: 179
XbaseResource.access$0(XbaseResource, String) line: 1
XbaseResource$2.exec(XbaseResource) line: 239
XbaseResource$2.exec(Object) line: 1
OnChangeEvictingCache.execWithoutCacheClear(Param,
IUnitOfWork<Result,Param>) line: 124
XcoreResource(XbaseResource).getEObject(String) line: 237
XcoreResource.getEObject(String) line: 170
XtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223
EcoreUtil.resolve(EObject, ResourceSet) line: 197
EcoreUtil.resolve(EObject, EObject) line: 257
XGenericTypeImpl(BasicEObjectImpl).eResolveProxy(InternalEObject) line: 1473
XGenericTypeImpl.getType() line: 232
XcoreEcoreBuilder$3.run() line: 552
XcoreEcoreBuilder.link() line: 120
XcoreModelAssociator.installDerivedState(DerivedStateAwareResource,
boolean) line: 81
XcoreResource(DerivedStateAwareResource).installDerivedState(boolean)
line: 125
XcoreResource(DerivedStateAwareResource).getContents() line: 48
XcoreResource$FragmentCache.get(String) line: 67
XcoreResource.getEObject(String) line: 156
XtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223
EcoreUtil.resolve(EObject, ResourceSet) line: 197
EcoreUtil.resolve(EObject, EObject) line: 257
XtextLinkingService.getResolvedEPackage(IEObjectDescription, EObject)
line: 183
XtextLinkingService.findPackageInScope(EObject, QualifiedName) line: 177
XtextLinkingService.getPackage(ReferencedMetamodel, ILeafNode) line: 157
XtextLinkingService.getLinkedObjects(EObject, EReference, INode) line: 95
XtextLinker(Linker).getLinkedObject(EObject, EReference, INode) line: 211
XtextLinker(Linker).ensureIsLinked(EObject, INode, CrossReference,
Set<EReference>, IDiagnosticProducer) line: 120
XtextLinker(Linker).ensureLinked(EObject, IDiagnosticProducer,
ICompositeNode, Set<EReference>) line: 69
XtextLinker(Linker).ensureLinked(EObject, IDiagnosticProducer) line: 56
XtextLinker(Linker).ensureModelLinked(EObject, IDiagnosticProducer) line: 236
XtextLinker(Linker).doLinkModel(EObject, IDiagnosticConsumer) line: 229
XtextLinker(AbstractCleaningLinker).linkModel(EObject,
IDiagnosticConsumer) line: 38
XtextLinker.linkModel(EObject, IDiagnosticConsumer) line: 220
GrammarResource(XtextResource).doLinking() line: 279
GrammarResource(LazyLinkingResource).doLinking() line: 82
GrammarResource.superDoLinking() line: 42
GrammarResource$LinkingTrigger.installDerivedState(DerivedStateAwareResource,
boolean) line: 75
GrammarResource(DerivedStateAwareResource).installDerivedState(boolean)
line: 125
GrammarResource(DerivedStateAwareResource).getContents() line: 48
EcoreUtil.getAllContents(Resource, boolean) line: 1121
GrammarResource(LazyLinkingResource).resolveLazyCrossReferences(CancelIndicator)
line: 97
EcoreUtil2.resolveLazyCrossReferences(Resource, CancelIndicator) line: 497
ClusteringBuilderState.doUpdate(BuildData, ResourceDescriptionsData,
IProgressMonitor) line: 204
ClusteringBuilderState(AbstractBuilderState).update(BuildData,
IProgressMonitor) line: 105
XtextBuilder.doBuild(ToBeBuilt, IProgressMonitor,
IXtextBuilderParticipant$BuildType) line: 159
XtextBuilder.incrementalBuild(IResourceDelta, IProgressMonitor) line: 141
XtextBuilder.build(int, Map, IProgressMonitor) line: 91
BuildManager$2.run() line: 728
SafeRunner.run(ISafeRunnable) line: 42
BuildManager.basicBuild(int, IncrementalProjectBuilder,
Map<String,String>, MultiStatus, IProgressMonitor) line: 199
BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext,
ICommand[], MultiStatus, IProgressMonitor) line: 239
BuildManager$1.run() line: 292
SafeRunner.run(ISafeRunnable) line: 42
BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext,
MultiStatus, IProgressMonitor) line: 295
BuildManager.basicBuildLoop(IBuildConfiguration[],
IBuildConfiguration[], int, MultiStatus, IProgressMonitor) line: 351
BuildManager.build(IBuildConfiguration[], IBuildConfiguration[], int,
IProgressMonitor) line: 374
AutoBuildJob.doBuild(IProgressMonitor) line: 143
AutoBuildJob.run(IProgressMonitor) line: 241
Worker.run() line: 54
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: How to access Xcore model from Xtext? [message #911329 is a reply to message #911328] |
Tue, 11 September 2012 11:58 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Christian,
Comments below.
On 11/09/2012 1:40 PM, Christian Dietrich wrote:
> Hi Ed,
>
> (EClass is EPackage and same is sample)
>
> see
>
> Thread [Worker-3] (Suspended (breakpoint at line 106 in
> LazyCreationProxyURIConverter))
> owns: XcoreResource (id=13155)
> owns: GrammarResource (id=13156)
> owns: ClusteringBuilderState (id=11449)
> LazyCreationProxyURIConverter.encodeFragment(EClass,
> QualifiedName) line: 106
> LazyCreationProxyURIConverter.getProxyURI(URI, EObject,
> QualifiedName) line: 67
> LazyCreationProxyURIConverter.installProxyURI(URI, EObject,
> QualifiedName) line: 57
> XcoreResourceDescriptionStrategy.createEObjectDescriptions(EObject, IAcceptor<IEObjectDescription>)
> line: 135
This method looks like this in the latest version, so the problem is
fixed in the maintenance stream. I.e., I'm reusing the same indexing
strategy as is used for Ecore resources. Sorry, I should have
considered that I've been fixing a lot of problems since the release!
public boolean createEObjectDescriptions(EObject eObject,
IAcceptor<IEObjectDescription> acceptor)
{
if (eObject.eClass().getEPackage() == EcorePackage.eINSTANCE)
{
return
ecoreResourceDescriptionStrategy.createEObjectDescriptions(eObject,
acceptor);
}
else
{
return super.createEObjectDescriptions(eObject, acceptor);
}
}
>
> XcoreResourceDescription(DefaultResourceDescription).computeExportedObjects()
> line: 88
> XcoreResourceDescription.getLookUp() line: 35
> XcoreResourceDescription(AbstractResourceDescription).isEmpty()
> line: 28
> SelectableBasedScope.createScope(IScope, ISelectable,
> Predicate<IEObjectDescription>, EClass, boolean) line: 29
> SelectableBasedScope.createScope(IScope, ISelectable, EClass,
> boolean) line: 25
>
> XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getResourceScope(IScope,
> EObject, EReference) line: 113
> XcoreImportedNamespaceAwareScopeProvider.getResourceScope(IScope,
> EObject, EReference) line: 82
>
> XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getResourceScope(Resource,
> EReference) line: 101
>
> XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getScope(EObject,
> EReference) line: 89
> XcoreImportedNamespaceAwareScopeProvider.getScope(EObject,
> EReference) line: 178
>
> XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getScope(EObject,
> EReference) line: 87
> XcoreImportedNamespaceAwareScopeProvider.getScope(EObject,
> EReference) line: 178
>
> XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getScope(EObject,
> EReference) line: 87
> XcoreImportedNamespaceAwareScopeProvider.getScope(EObject,
> EReference) line: 178
>
> XcoreImportedNamespaceAwareScopeProvider(ImportedNamespaceAwareLocalScopeProvider).getScope(EObject,
> EReference) line: 87
> XcoreImportedNamespaceAwareScopeProvider.getScope(EObject,
> EReference) line: 178
> XcoreScopeProvider(XtypeScopeProvider).getScope(EObject,
> EReference) line: 33
> XcoreScopeProvider(XbaseScopeProvider).getScope(EObject,
> EReference) line: 187
> XcoreScopeProvider.getScope(EObject, EReference) line: 217
> XbaseLinkingScopeProvider.getScope(EObject, EReference) line: 42
> DefaultLinkingService.getScope(EObject, EReference) line: 59
> DefaultLinkingService.getLinkedObjects(EObject, EReference, INode)
> line: 119
> XcoreResource(LazyLinkingResource).getEObject(String) line: 179
> XbaseResource.access$0(XbaseResource, String) line: 1
> XbaseResource$2.exec(XbaseResource) line: 239
> XbaseResource$2.exec(Object) line: 1
> OnChangeEvictingCache.execWithoutCacheClear(Param,
> IUnitOfWork<Result,Param>) line: 124
> XcoreResource(XbaseResource).getEObject(String) line: 237
> XcoreResource.getEObject(String) line: 170
> XtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223
> EcoreUtil.resolve(EObject, ResourceSet) line: 197
> EcoreUtil.resolve(EObject, EObject) line: 257
> XGenericTypeImpl(BasicEObjectImpl).eResolveProxy(InternalEObject)
> line: 1473
> XGenericTypeImpl.getType() line: 232
> XcoreEcoreBuilder$3.run() line: 552
> XcoreEcoreBuilder.link() line: 120
> XcoreModelAssociator.installDerivedState(DerivedStateAwareResource, boolean)
> line: 81
> XcoreResource(DerivedStateAwareResource).installDerivedState(boolean)
> line: 125
> XcoreResource(DerivedStateAwareResource).getContents() line: 48
> XcoreResource$FragmentCache.get(String) line: 67
> XcoreResource.getEObject(String) line: 156
> XtextResourceSet(ResourceSetImpl).getEObject(URI, boolean) line: 223
> EcoreUtil.resolve(EObject, ResourceSet) line: 197
> EcoreUtil.resolve(EObject, EObject) line: 257
> XtextLinkingService.getResolvedEPackage(IEObjectDescription,
> EObject) line: 183
> XtextLinkingService.findPackageInScope(EObject, QualifiedName)
> line: 177
> XtextLinkingService.getPackage(ReferencedMetamodel, ILeafNode)
> line: 157
> XtextLinkingService.getLinkedObjects(EObject, EReference, INode)
> line: 95
> XtextLinker(Linker).getLinkedObject(EObject, EReference, INode)
> line: 211
> XtextLinker(Linker).ensureIsLinked(EObject, INode, CrossReference,
> Set<EReference>, IDiagnosticProducer) line: 120
> XtextLinker(Linker).ensureLinked(EObject, IDiagnosticProducer,
> ICompositeNode, Set<EReference>) line: 69
> XtextLinker(Linker).ensureLinked(EObject, IDiagnosticProducer)
> line: 56
> XtextLinker(Linker).ensureModelLinked(EObject,
> IDiagnosticProducer) line: 236
> XtextLinker(Linker).doLinkModel(EObject, IDiagnosticConsumer)
> line: 229
> XtextLinker(AbstractCleaningLinker).linkModel(EObject,
> IDiagnosticConsumer) line: 38
> XtextLinker.linkModel(EObject, IDiagnosticConsumer) line: 220
> GrammarResource(XtextResource).doLinking() line: 279
> GrammarResource(LazyLinkingResource).doLinking() line: 82
> GrammarResource.superDoLinking() line: 42
>
> GrammarResource$LinkingTrigger.installDerivedState(DerivedStateAwareResource,
> boolean) line: 75
>
> GrammarResource(DerivedStateAwareResource).installDerivedState(boolean) line:
> 125
> GrammarResource(DerivedStateAwareResource).getContents() line: 48
> EcoreUtil.getAllContents(Resource, boolean) line: 1121
>
> GrammarResource(LazyLinkingResource).resolveLazyCrossReferences(CancelIndicator)
> line: 97
> EcoreUtil2.resolveLazyCrossReferences(Resource, CancelIndicator)
> line: 497
> ClusteringBuilderState.doUpdate(BuildData,
> ResourceDescriptionsData, IProgressMonitor) line: 204
> ClusteringBuilderState(AbstractBuilderState).update(BuildData,
> IProgressMonitor) line: 105
> XtextBuilder.doBuild(ToBeBuilt, IProgressMonitor,
> IXtextBuilderParticipant$BuildType) line: 159
> XtextBuilder.incrementalBuild(IResourceDelta, IProgressMonitor)
> line: 141
> XtextBuilder.build(int, Map, IProgressMonitor) line: 91
> BuildManager$2.run() line: 728
> SafeRunner.run(ISafeRunnable) line: 42
> BuildManager.basicBuild(int, IncrementalProjectBuilder,
> Map<String,String>, MultiStatus, IProgressMonitor) line: 199
> BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext,
> ICommand[], MultiStatus, IProgressMonitor) line: 239
> BuildManager$1.run() line: 292
> SafeRunner.run(ISafeRunnable) line: 42
> BuildManager.basicBuild(IBuildConfiguration, int, IBuildContext,
> MultiStatus, IProgressMonitor) line: 295
> BuildManager.basicBuildLoop(IBuildConfiguration[],
> IBuildConfiguration[], int, MultiStatus, IProgressMonitor) line: 351
> BuildManager.build(IBuildConfiguration[], IBuildConfiguration[],
> int, IProgressMonitor) line: 374
> AutoBuildJob.doBuild(IProgressMonitor) line: 143
> AutoBuildJob.run(IProgressMonitor) line: 241
> Worker.run() line: 54
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | |
Goto Forum:
Current Time: Fri Apr 26 22:30:43 GMT 2024
Powered by FUDForum. Page generated in 0.05703 seconds
|