Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Unresolved JvmTypeReference's when loading model manually
Unresolved JvmTypeReference's when loading model manually [message #1451757] Fri, 24 October 2014 08:47 Go to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 148
Registered: February 2013
Senior Member
Hey,

We have a DSL that allows references to Java types. For this, the grammar is "with org.eclipse.xtext.xbase.Xtype" and references to java types are implemented by just putting "jvmRef=JvmTypeReference" in the grammar.

This works flawlessly in the IDE, no problem at all. We have generators that generate java code using the usual IGenerator infrastructure, and they work without problems.

Now we want to load an read/analyze/process the model files "manually" by loading a Resource into an XtextResourceSet, and when we do so, all the jvmRef's are unresolved. We get some NPEs and when looking at the JvmTypeReference in the debugger it comes out as JvmVoidImplCustom .... Neutral

What are we doing wrong? Is there some explicit "resolve it now, please" call that we need to do that is specific to Xtype? We have other references to elements within the same DSL but different files that work without any problems...

Thanks in advance for any hint!

Cheers,
Markus
Re: Unresolved JvmTypeReference's when loading model manually [message #1451770 is a reply to message #1451757] Fri, 24 October 2014 09:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi did you set the resourcesets classpathuricontext?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unresolved JvmTypeReference's when loading model manually [message #1451771 is a reply to message #1451770] Fri, 24 October 2014 09:08 Go to previous messageGo to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 148
Registered: February 2013
Senior Member
Nope. what is this and how do we do that? Is there a documentation pointer? We're getting the XtextResourceSet through @Inject, so I expected that to be set up all right already...?

Cheers, Thanks,
Markus
Re: Unresolved JvmTypeReference's when loading model manually [message #1451776 is a reply to message #1451771] Fri, 24 October 2014 09:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Standalone or IDE?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unresolved JvmTypeReference's when loading model manually [message #1451777 is a reply to message #1451771] Fri, 24 October 2014 09:17 Go to previous messageGo to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 148
Registered: February 2013
Senior Member
I think I have an idea of the problem. We're injecting the XtextResourceSet directly. I think we need the XtextResourceSetProvider from xtext.ui to initialize the java type support for us, correct?
Re: Unresolved JvmTypeReference's when loading model manually [message #1451780 is a reply to message #1451776] Fri, 24 October 2014 09:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
If you are in the IDE: yes use IResouceSetProvider

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unresolved JvmTypeReference's when loading model manually [message #1451781 is a reply to message #1451776] Fri, 24 October 2014 09:20 Go to previous message
Markus Duft is currently offline Markus DuftFriend
Messages: 148
Registered: February 2013
Senior Member
IDE. Maybe (really only maybe) we need to parse those files later on inside the target application also, but I guess we'd need a different type of java type resolution then...?
Previous Topic:WHILE TEMPLATE IN XTEND
Next Topic:Xtext IResourceValidator linking errors
Goto Forum:
  


Current Time: Thu Apr 18 21:02:21 GMT 2024

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

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

Back to the top