Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Solved] Xtext 2.10 - Cannot reference common JavaVMTypes in model
[Solved] Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742121] Wed, 31 August 2016 14:57 Go to next message
Sakis Kotisis is currently offline Sakis KotisisFriend
Messages: 33
Registered: July 2009
Location: Belgium
Member
Hi,

I'm trying to go through the tutorial at https://eclipse.org/Xtext/documentation/305_xbase.html .

Mapping a datatype to a Java element, does not seem to work.

Instead at the line:

datatype Date mapped-to java.util.Date


I get the following error message:

Couldn't resolve reference to JvmType 'java.util.Date'.


I've tried adding a reference to the common Java types in the language definition, like this:

language = StandardLanguage {
	name = "org.example.domainmodel.Domainmodel"
	fileExtensions = "dmodel"
	referencedResource=
		"platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel"

	serializer = {
		generateStub = false
	}
	validator = {
		// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
	}
}


However i still get the same error.

Am i or the tutorial missing something?

[Updated on: Thu, 01 September 2016 11:43]

Report message to a moderator

Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742122 is a reply to message #1742121] Wed, 31 August 2016 15:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13882
Registered: July 2009
Senior Member
Does your grammar inherit from xbase?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742123 is a reply to message #1742122] Wed, 31 August 2016 15:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13882
Registered: July 2009
Senior Member
e.g grammar org.xtext.example.mydsl1.MyDsl with org.eclipse.xtext.xbase.Xtype


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742124 is a reply to message #1742123] Wed, 31 August 2016 15:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13882
Registered: July 2009
Senior Member
if not you can

commonTypesSupport = {
onlyEnabledIfGrammarIsUsed = false
}


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742275 is a reply to message #1742124] Thu, 01 September 2016 11:42 Go to previous messageGo to next message
Sakis Kotisis is currently offline Sakis KotisisFriend
Messages: 33
Registered: July 2009
Location: Belgium
Member
Thank you Christian, this works!

The grammar in the tutorial inherits from org.eclipse.xtext.common.Terminals.

Maybe the tutorial should be updated accordingly:
https://eclipse.org/Xtext/documentation/305_xbase.html
Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742277 is a reply to message #1742275] Thu, 01 September 2016 12:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13882
Registered: July 2009
Senior Member
i will add a hint

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742278 is a reply to message #1742277] Thu, 01 September 2016 12:14 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13882
Registered: July 2009
Senior Member
https://github.com/eclipse/xtext-eclipse/issues/69

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:xtext class not found error
Next Topic:Add xtext nature programmatically
Goto Forum:
  


Current Time: Wed Apr 14 09:55:06 GMT 2021

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

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

Back to the top