Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to programmatically force indexing of new EO/Res? (Creating EObjectDescription)
How to programmatically force indexing of new EO/Res? (Creating EObjectDescription) [message #1289834] Wed, 09 April 2014 17:36
Michael Vorburger is currently offline Michael VorburgerFriend
Messages: 62
Registered: July 2009
Member
Aloha Xtextians,

consider https://github.com/vorburger/xtext-sandbox/blob/master/SerializerCrossRefNewResEObjHowTo/org.xtext.example.mydsl/src/org/xtext/example/mydsl/generator/MyDslGenerator.xtend (JUST AN EXAMPLE), what does one have to do to avoid that causing the exception copy/pasted below?

I do understand what it's telling me - there is no EObjectDescription, which is normal because the Xtext Builder has not yet had a chance to run to index the Greeting b which was JUST created. We still need it to work Wink though - so how does one programmatically request, say on the line 27 in the middle there, to "hey buddy, now plz dig that Greeting b (more likely its containing Resource) so that I can ref. it" ?

Thank you!!

___
0 [Worker-1] ERROR org.eclipse.xtext.builder.BuilderParticipant - Error during compilation of 'platform:/resource/Models/some.mydsl'.
java.lang.RuntimeException: No EObjectDescription could be found in Scope Greeting.anotherGreeting for Greeting'b'
Semantic Object: Greeting'a'
at org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic$ExceptionThrowingAcceptor.accept(ISerializationDiagnostic.java:70)
at org.eclipse.xtext.serializer.tokens.CrossReferenceSerializer.getCrossReferenceNameFromScope(CrossReferenceSerializer.java:146)
at org.eclipse.xtext.serializer.tokens.CrossReferenceSerializer.serializeCrossRef(CrossReferenceSerializer.java:119)
at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.getToken(SequenceFeeder.java:453)
at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.accept(SequenceFeeder.java:220)
at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.accept(BacktrackingSemanticSequencer.java:403)
at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.createSequence(BacktrackingSemanticSequencer.java:441)
at org.xtext.example.mydsl.serializer.MyDslSemanticSequencer.sequence_Greeting(MyDslSemanticSequencer.java:40)
at org.xtext.example.mydsl.serializer.MyDslSemanticSequencer.createSequence(MyDslSemanticSequencer.java:27)
at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:85)
at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:108)
at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:130)
at org.eclipse.xtext.resource.XtextResource.doSave(XtextResource.java:344)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
at org.xtext.example.mydsl.generator.MyDslGenerator.serialize(MyDslGenerator.java:46)
at org.xtext.example.mydsl.generator.MyDslGenerator.doGenerate(MyDslGenerator.java:30)
at org.eclipse.xtext.builder.BuilderParticipant.handleChangedContents(BuilderParticipant.java:331)
Previous Topic:Supporting a complex languge
Next Topic:Couldn't resolve reference to .....
Goto Forum:
  


Current Time: Thu Dec 18 23:16:37 GMT 2014

Powered by FUDForum. Page generated in 0.01515 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software