Skip to main content



      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 10:57 Go to next message
Eclipse UserFriend
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 07:43] by Moderator

Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742122 is a reply to message #1742121] Wed, 31 August 2016 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Does your grammar inherit from xbase?
Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742123 is a reply to message #1742122] Wed, 31 August 2016 11:24 Go to previous messageGo to next message
Eclipse UserFriend
e.g grammar org.xtext.example.mydsl1.MyDsl with org.eclipse.xtext.xbase.Xtype
Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742124 is a reply to message #1742123] Wed, 31 August 2016 11:26 Go to previous messageGo to next message
Eclipse UserFriend
if not you can

commonTypesSupport = {
onlyEnabledIfGrammarIsUsed = false
}
Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742275 is a reply to message #1742124] Thu, 01 September 2016 07:42 Go to previous messageGo to next message
Eclipse UserFriend
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 08:08 Go to previous messageGo to next message
Eclipse UserFriend
i will add a hint
Re: Xtext 2.10 - Cannot reference common JavaVMTypes in model [message #1742278 is a reply to message #1742277] Thu, 01 September 2016 08:14 Go to previous message
Eclipse UserFriend
https://github.com/eclipse/xtext-eclipse/issues/69
Previous Topic:xtext class not found error
Next Topic:Add xtext nature programmatically
Goto Forum:
  


Current Time: Fri Jul 04 15:22:00 EDT 2025

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

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

Back to the top